-
-
Notifications
You must be signed in to change notification settings - Fork 6
Protocol Overview
coe0718 edited this page May 23, 2026
·
3 revisions
Deskbrid uses a simple JSON-over-Unix-socket protocol for communicating with the daemon.
The daemon listens on a Unix socket at /run/user/$UID/deskbrid.sock.
# Default socket path
/run/user/1000/deskbrid.sockAll messages are JSON objects terminated by a newline character.
{"action": "windows.list"}With parameters:
{
"action": "input.keyboard",
"action": "type",
"text": "Hello!"
}Success:
{
"type": "response",
"status": "ok",
"data": [...]
}Error:
{
"type": "response",
"status": "error",
"error": {
"code": "not_found",
"message": "Window not found"
}
}{
"type": "event",
"event": "window.focused",
"data": {
"window_id": "12345678"
}
}The protocol supports over 90 actions organized by domain:
-
system.info- Get system information -
system.capabilities- List supported features -
system.health- Check system health -
system.power- Power actions (suspend, reboot, shutdown) -
system.battery- Battery status -
system.idle- Idle detection
-
windows.list- List all windows -
windows.focus- Focus a window -
windows.get- Get window details -
windows.close- Close a window -
windows.tile- Tile window to preset position -
windows.activate_or_launch- Find or start an app
-
input.keyboard- Type text or send key combinations -
input.mouse- Move, click, scroll
-
clipboard.read- Read clipboard -
clipboard.write- Write to clipboard -
clipboard.history- Get clipboard history
-
screenshot- Capture screen -
screenshot.ocr- Capture with OCR -
screenshot.diff- Compare screenshots
-
notification.send- Send desktop notification -
notification.close- Close notification
-
service.list- List systemd services -
service.start- Start a service -
service.stop- Stop a service
-
terminal.create- Create PTY session -
terminal.write- Write to terminal -
terminal.read- Read from terminal
See full action list for all available actions.
Subscribe to real-time events:
{"action": "events.subscribe", "events": ["window.*", "input.*"]}Available event patterns:
-
window.*- Window events (focus, close, open) -
input.*- Input events -
clipboard.*- Clipboard changes -
monitor.*- Display changes
Events are streamed continuously until you unsubscribe or close the connection.
import socket
import json
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect("/run/user/1000/deskbrid.sock")
# Send request
sock.send(b'{"action": "windows.list"}\n')
# Read response
response = sock.recv(4096)
data = json.loads(response)
print(data)| Code | Description |
|---|---|
invalid_params |
Invalid or missing parameters |
not_found |
Resource not found |
permission_denied |
Insufficient permissions |
not_supported |
Feature not supported on this system |
backend_error |
Backend-specific error |
internal_error |
Internal daemon error |
For long-running operations, the protocol returns immediately with a request ID:
{"action": "terminal.create"}Response:
{
"type": "response",
"status": "ok",
"data": {"terminal_id": "term_123"},
"request_id": "abc123"
}- Accessibility
- Apps
- Audio
- Backlight (LED driver)
- Bluetooth
- Clipboard
- Color Picker
- Desktop Portal
- Desktop Settings
- Files
- Hotkeys
- Input
- Keyboard Layouts
- Media (MPRIS)
- Monitors
- Network
- Notifications
- Print (CUPS)
- Screenshots
- Screen Recording
- Screencast
- Self-Update
- System
- System Tray
- Systemd Units & Timers
- Terminals (PTY)
- Windows & Workspaces