Linux
agent-desktop reads Linux apps through AT-SPI over D-Bus. The loop, refs, JSON envelope, sessions, and traces match every platform, so this page covers only what differs on Linux. GNOME is the measured desktop; X11 and Wayland sessions both work and differ in input, capture, and window control. The examples on this page ran on an X11 session (Xvfb with the openbox window manager, no GNOME Shell), so shell surfaces and notifications were not exercised.
Requirements
- Ubuntu 24.04 or later on x86_64 or aarch64, with a glibc 2.35 floor. Other distributions need an
at-spi2-corebridge with fix (commitdc0dc33); Ubuntu 22.04's bridge aborts onAction.GetActions. - A graphical session of the signed-in user, a running AT-SPI bus (
at-spi2-core), and a window manager. Run agent-desktop from a shell inside that session: the session bus, display, and runtime directory come from its environment. A TTY login, an SSH shell without those variables, a container without a bus, or another user's session sees no apps. - X11 keys need XTEST, and Wayland keys need GNOME Mutter RemoteDesktop. The Wayland clipboard needs
wl-clipboard. - On X11,
clipboard-setneedsagent-desktop-linux-clipboard-ownerbeside the binary. npm installs and release archives include it; from source, build it withcargo build --release -p agent-desktop-linux --bins. - A private state root. A group-writable or world-readable
~/.agent-desktopmakes commands that write there fail withPERM_DENIED. Runchmod 700on it, or let agent-desktop create it.
Check the accessibility bus
Linux has no permission dialog for accessibility; whether the bus answers gates everything. Run status first:
| State | What status and list-apps show | Meaning |
|---|---|---|
| Answered, healthy | accessibility is granted, supported_surfaces lists surfaces, list-apps returns rows | Normal |
| Answered, empty | granted, but list-apps returns no rows | The bus is up and no app registered. Start an app, or restart one that started before the bus |
| Unavailable | denied with a suggestion, empty supported_surfaces, and commands fail with PLATFORM_NOT_SUPPORTED | The session bus or the accessibility bus cannot be reached |
An unavailable bus has four usual causes, each reported with the raw D-Bus error in platform_detail:
- No session bus. Run inside a desktop session, or start one with
dbus-run-session -- COMMAND. - AT-SPI not installed. Install
at-spi2-core. For Flatpak add--talk-name=org.a11y.Bus; for snap connectdesktop-legacyorunity7. - Launcher cannot start. Read
systemctl --user status at-spi-dbus-bus.service. - Socket gone. Restart
at-spi-dbus-bus.service, or log out and back in.
Judge health with status, not with busctl: on a cold session org.a11y.Bus has no owner until its first use. Do not restart a bus you did not start, because other clients on a shared host depend on it.
What works headless
Ref actions are semantic AT-SPI calls that never move the pointer or change the active window. Under --headed on X11, click, right-click, and type try physical input first and fall back to the semantic action only after a not_delivered refusal. See Headed mode.
| Group | Works headless | Needs --headed | Fails closed or not supported |
|---|---|---|---|
| Observation and surfaces | snapshot, find, get, is, list-surfaces, on X11 and Wayland | ||
| Ref actions | click, right-click, type, set-value, clear, select, toggle, check, uncheck, expand, collapse, scroll-to, when the element exposes the AT-SPI capability | focus; type into a terminal text node; some Qt and libadwaita combos for select; a GTK4 or Qt action that opens a popup, a menu or a dialog (headless: POLICY_DENIED, check foreground) | An element with no semantic route refuses and never falls back to physical input |
| Wheel scrolling | scroll, mouse-wheel, X11 only | Headless scroll: POLICY_DENIED | |
| Pointer gestures | double-click, triple-click, hover, drag, mouse-click, mouse-move, X11 only | Wayland: ACTION_NOT_SUPPORTED, cause wayland_session | |
| Keyboard | Scoped press (--app or --window-id) on X11 and Mutter Wayland. A scoped headless press needs the target window already active | Unscoped press; a scoped press to a background app (X11) | Blocked combos such as alt+f4 without --force |
| Held input | key-down, key-up, mouse-down, mouse-up | ||
| App and window | launch, list-apps, list-windows on X11 and Wayland; window control and close-app --force on X11 | focus-window on X11; a graceful close-app of an app with unsaved work: the save prompt keeps the app open and is reported as dialog_pending | focus-window and window control on Wayland: ACTION_NOT_SUPPORTED. A headless graceful close-app of a native Wayland client returns ACTION_NOT_SUPPORTED with details.cause: wayland_session. One that cannot read the focused window returns POLICY_DENIED with details.kind: focus_unreadable before any close request is sent. |
| Capture | screenshot, list-displays | X11 under a compositing window manager (GNOME): display and --screen captures return PLATFORM_NOT_SUPPORTED (details.reason: "compositing"); capture one window instead. Wayland: portal consent on first use, and window targets are PLATFORM_NOT_SUPPORTED | |
| Clipboard | clipboard-get (text, images, file lists) | clipboard-set, clipboard-clear (text, images, file lists) | Missing helper or wl-clipboard: PLATFORM_NOT_SUPPORTED |
| Wait | All modes; --notification on GNOME | ||
| Notifications | list-notifications, even with the list closed | Every dismiss and action, on X11 | GNOME Shell only; otherwise PLATFORM_NOT_SUPPORTED |
| Shell surfaces | snapshot --surface system-tray with a StatusNotifierWatcher | open-system-surface for action-center, and for system-tray when a StatusNotifierWatcher is present | quick-settings, taskbar, start-menu, and system-tray-overflow refuse |
| System | status, permissions, version, batch, skills, session, trace, cursor-overlay | Wayland: the overlay setting saves with rendered: false |
App naming
--app takes the name list-apps prints, such as gnome-calculator, or a desktop-entry name or id backed by a verified executable, such as Files. It never matches a window title.
list-windows --app is an exact, case-insensitive match; list-apps --app also matches a substring. Window ids are opaque strings such as w-1.11-org-gnome-Calculator-a11y-..., valid for the life of the window's process. Several instances of one app share a name; pick one with --window-id. launch accepts an absolute path, a desktop id, a bare command, or a desktop entry name.
Surfaces
supported_surfaces lists window, sheet, alert, and menu, plus GNOME Shell kinds the session can resolve. After an opener, read data.surfaces. A GTK popover appears asynchronously, so if it is absent, run wait --menu before you assume the opener failed. A list-backed GTK4 dropdown is part of the window tree, not a menu surface. A GTK4 list or grid view exposes its items without row nodes, so select and click cannot pick a row. See Surfaces.
Chromium, Qt, and Electron
An app appears in list-apps only when its toolkit registered on the accessibility bus.
| App | Needs |
|---|---|
| GTK3, GTK4 | Nothing. An app that started before the bus never registers: restart it |
| Qt | QT_ACCESSIBILITY=1 in its environment |
| Chromium browsers | --force-renderer-accessibility; in a bare session without a settings daemon, also --env ACCESSIBILITY_ENABLED=1 on launch |
| Electron | No flag. --no-sandbox where chrome-sandbox is not setuid |
To drive the web contents with agent-browser instead, launch the app with --cdp; see Chromium and Electron apps. GTK apps nest deeply with unnamed group wrappers that -i --compact keeps; read past them, or let a skeleton find the drill targets. Electron native dialogs are not on the AT-SPI tree.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Empty supported_surfaces, or PLATFORM_NOT_SUPPORTED about the AT-SPI bus | The session bus or accessibility bus is unreachable | Run inside the desktop session; see the four causes above |
list-apps or snapshot returns ACTION_NOT_SUPPORTED, "The native window type of accessibility frame owned by pid N could not be proven" | No window manager is running, so windows cannot be matched to their X11 clients | Run inside a real desktop session, or start a window manager |
The app runs but --app finds nothing | The app is not on the bus, or the name is wrong | Use the list-apps name, and see the toolkit table |
The window appears but snapshot is thin | The content is not ready | wait --window, then wait --text, and raise --timeout-ms |
ACTION_FAILED, cause frame_not_active, on a scoped press | The target window is not active and focus changes are not allowed | Bring the window forward, or pass --headed if focus changes are permitted |
ACTION_FAILED, cause blocked_by_modal_dialog | A modal dialog or popover blocks the window | Read it with snapshot --surface and answer or dismiss it |
ACTION_FAILED, cause grab_focus_rejected, on focus | A GTK4 app rejects Component.GrabFocus | Focus its window with --headed focus-window |
Two quick click calls on one GTK4 button act once | GTK4 reads clicks less than about 250 ms apart as one | Wait for the effect between clicks |
--menu-closed returns at once | The menu never opened | Wait for --menu first |
screenshot returns ACTION_FAILED with details.reason: "covered" | A non-compositing window manager cannot capture a covered window | Raise it with --headed focus-window; on a non-compositing window manager, capture the display with --screen 0 |
PERM_DENIED, "private file parent is accessible by group or other users" | The state root is not private | chmod 700 the state root |
More cases are in agent-desktop skills get linux.