Runtime contract
This page defines the current public output contract for deskctl.
It is intentionally scoped to the current Linux X11 runtime surface. It does not promise stability for future Wayland or window-manager-specific features.
Stable top-level envelope
Every command supports --json and uses the same top-level envelope:
{
"success": true,
"data": {},
"error": null
}
Stable top-level fields:
successdataerror
If success is false, the command exits non-zero in both text mode and JSON
mode.
Stable window payload
Whenever a response includes a window payload, these fields are stable:
ref_idwindow_idtitleapp_namexywidthheightfocusedminimized
window_id is the public session-scoped identifier for programmatic targeting.
ref_id is a short-lived convenience handle from the current ref map.
Stable grouped reads
deskctl get active-window
- stable:
data.window
deskctl get monitors
- stable:
data.count - stable:
data.monitors
Stable per-monitor fields:
namexywidthheightwidth_mmheight_mmprimaryautomatic
deskctl get version
- stable:
data.version - stable:
data.backend
deskctl get systeminfo
- stable:
data.backend - stable:
data.display - stable:
data.session_type - stable:
data.session - stable:
data.socket_path - stable:
data.screen - stable:
data.monitor_count - stable:
data.monitors
Stable waits
deskctl wait window
deskctl wait focus
- stable:
data.wait - stable:
data.selector - stable:
data.elapsed_ms - stable:
data.window
Stable selector-driven action fields
When selector-driven actions return resolved window data, these fields are stable when present:
data.ref_iddata.window_iddata.titledata.selector
This applies to:
clickdblclickfocusclosemove-windowresize-window
Stable artifact fields
For snapshot and screenshot:
- stable:
data.screenshot
When a command also returns windows, data.windows uses the stable window
payload documented above.
Stable structured error kinds
When a command fails with structured JSON data, these error kinds are stable:
selector_not_foundselector_ambiguousselector_invalidtimeoutnot_foundwindow_not_focusedindata.last_observation.kindor an equivalent wait observation payload
Stable structured failure fields include:
data.kinddata.selectordata.modedata.candidatesdata.messagedata.waitdata.timeout_msdata.poll_msdata.last_observation
Best-effort fields
These values are useful but environment-dependent and should not be treated as strict parsing guarantees:
- exact monitor naming conventions
- EWMH/window-manager-dependent ordering details
- cosmetic text formatting in non-JSON mode
- default screenshot file names when no explicit path was provided
- stderr wording outside the structured
kindclassifications above
Text mode expectations
Text mode is intended to stay compact and follow-up-useful.
The exact whitespace and alignment are not stable. The stable behavioral expectations are:
- important reads print actionable identifiers or geometry
- selector failures print enough detail to recover without
--json - artifact-producing commands print the artifact path
- window listings print both
@wNrefs andwindow_idvalues
If you need strict parsing, use --json.