plugins/_office/skills/linux-desktop/SKILL.md
Use the Desktop as a full Linux GUI when the user explicitly needs a visual workflow, an installed desktop app, or manual layout polish that is awkward through structured file edits alone. Agent Zero may warm the persistent Desktop runtime during initial startup, but visible Desktop/canvas use remains opt-in. The Desktop is opt-in at the UI level: do not open the canvas just because the user asks for a document. Use structured tools first for deterministic content changes, then use the Desktop for inspection, GUI-only actions, and final visual confirmation.
The Desktop is an observe-act-verify control surface. Use this decision hierarchy:
document_artifact for deterministic file creation, reads, and edits.desktopctl.sh calc-set-cell for Calc/UNO spreadsheet changes.observe --json --screenshot captured after the command has finished or visibly returned to an input prompt. Do not report from an earlier screenshot path.Keep these standing rules:
/a0/plugins/_office/skills/linux-desktop/scripts/desktopctl.sh.Use the helper script when the Desktop is already open and you need reliable app launches, clicks, keystrokes, or window checks from the agent shell. In the live Agent Zero runtime, prefer the absolute path so the command works from any current directory:
DESKTOP=/a0/plugins/_office/skills/linux-desktop/scripts/desktopctl.sh
$DESKTOP check
$DESKTOP state --json
$DESKTOP observe --json --screenshot
$DESKTOP launch calc
$DESKTOP wait-window LibreOffice
$DESKTOP windows LibreOffice
$DESKTOP focus LibreOffice
$DESKTOP key ctrl+s
The script targets the persistent agent-zero-desktop X display, sets DISPLAY, XAUTHORITY, and HOME to the XFCE profile, then uses xdotool for input. Startup normally prepares this session. If check fails during explicit Desktop work, report that the Desktop runtime is not ready instead of installing packages ad hoc.
For direct app launches without coordinates:
DESKTOP=/a0/plugins/_office/skills/linux-desktop/scripts/desktopctl.sh
$DESKTOP launch writer
$DESKTOP launch calc
$DESKTOP launch impress
$DESKTOP launch terminal
$DESKTOP launch settings
$DESKTOP open-path /a0/usr/workdir
$DESKTOP focus "LibreOffice"
$DESKTOP paste-text "Text to insert"
$DESKTOP key ctrl+s
For live spreadsheet coworking, use the Calc helper instead of hand-written UNO snippets:
DESKTOP=/a0/plugins/_office/skills/linux-desktop/scripts/desktopctl.sh
$DESKTOP calc-set-cell /a0/usr/workdir/example.xlsx Sheet1 B2 "Cowork verified live"
This opens the workbook in the visible Desktop Calc session if needed, changes the cell through LibreOffice, saves the workbook, and verifies the .xlsx on disk. Because the edit happens through the running LibreOffice session, the user can see the sheet update without refreshing the Desktop surface.
For coordinate actions, clicks are explicitly last resort. First try launch, open-path, wait-window, focus, key, paste-text, save, or an app-native helper. If a coordinate action is still necessary, base it on a fresh screenshot observation and verify immediately afterward:
DESKTOP=/a0/plugins/_office/skills/linux-desktop/scripts/desktopctl.sh
$DESKTOP observe --json --screenshot
$DESKTOP click 120 180
$DESKTOP dblclick 120 180
$DESKTOP right-click 120 180
$DESKTOP drag 120 180 400 180
$DESKTOP scroll down 3
$DESKTOP type "Text to enter"
$DESKTOP observe --json
When browser automation is available, the higher-level QA flow is:
http://127.0.0.1:32080.Alpine.store("rightCanvas").open("office").desktopctl.sh location and desktopctl.sh windows PATTERN.Terminal apps are visual state, not structured logs. When the task depends on exact terminal output, follow this stricter loop:
desktopctl.sh observe --json --screenshot immediately before acting to record the starting window and screenshot path.focus, paste-text or type, and key Return to drive the terminal. Prefer CLI-native commands and keyboard input over clicks.desktopctl.sh observe --json --screenshot.For nested CLI agents, a successful proof requires both the input prompt and the nested agent's visible response in the final screenshot, or another deterministic saved transcript produced by the CLI itself.
Guard the boundary between the shell and the target CLI carefully:
root@...# means the target CLI is not currently receiving chat input. Never paste natural-language text into that shell prompt unless it is deliberately quoted as an argument to a shell command.command not found, do not continue by sending the chat message. Start the fallback CLI command or report the blocker.>, Implement {feature}, or a CLI-specific input box inside the terminal is different from a shell prompt. Only then should paste-text "natural language" followed by key Return be used as chat input.Example for a nested CLI-agent smoke test:
DESKTOP=/a0/plugins/_office/skills/linux-desktop/scripts/desktopctl.sh
$DESKTOP focus "Terminal"
$DESKTOP paste-text 'TARGET_CLI="example-cli-agent"; FALLBACK_CMD=""; if command -v "$TARGET_CLI" >/dev/null 2>&1; then "$TARGET_CLI"; elif [ -n "$FALLBACK_CMD" ]; then sh -lc "$FALLBACK_CMD"; else echo "CLI agent not found: $TARGET_CLI"; fi'
$DESKTOP key Return
$DESKTOP observe --json --screenshot
# Verify the screenshot shows the target CLI prompt, not a shell prompt, before sending natural language:
$DESKTOP paste-text 'Reply with exactly the requested smoke-test token.'
$DESKTOP key Return
$DESKTOP observe --json --screenshot
The Desktop exposes stable folders for common user work:
Workdir -> configured Agent Zero workdir (default /a0/usr/workdir)Projects -> /a0/usr/projectsSkills -> /a0/usr/skillsAgents -> /a0/usr/agentsDownloads -> /a0/usr/downloadsUse these folders when the user asks to inspect or manipulate project files, skills, agent profiles, or downloaded artifacts from the GUI.
LibreOffice Writer: ODT word processing and DOCX compatibility layout.LibreOffice Calc: ODS spreadsheets, formulas, tables, charts, and XLSX compatibility.LibreOffice Impress: ODP presentations, slide polish, and PPTX compatibility.Workdir: graphical file management with Thunar at the configured Agent Zero workdir (default /a0/usr/workdir).Terminal: shell work inside the Agent Zero runtime.Settings: XFCE system settings.desktopctl.sh calc-set-cell FILE SHEET CELL VALUE.