Skip to content

Features Windows Workspaces

coe0718 edited this page May 23, 2026 · 3 revisions

Windows & Workspaces

Manage windows and virtual desktops programmatically.

Windows

List Windows

deskbrid windows list
{"type": "windows.list"}

Response:

{
  "type": "response",
  "status": "ok",
  "data": [
    {
      "id": "12345678",
      "title": "deskbrid – ~/projects/deskbrid/docs/wiki",
      "app_id": "org.gnome.Terminal",
      "workspace": 1,
      "x": 100,
      "y": 50,
      "width": 1280,
      "height": 720,
      "focused": false,
      "minimized": false
    }
  ]
}

Focus Window

deskbrid windows focus --app code
deskbrid windows focus --window 12345678
deskbrid windows focus --title "VS Code" --exact

Protocol:

{"type": "windows.focus", "window_id": "code"}

Get Window Details

deskbrid windows get 12345678

Protocol:

{"type": "windows.get", "window_id": "12345678"}

Close Window

deskbrid windows close --app code

Protocol:

{"type": "windows.close", "window_id": "code"}

Minimize/Maximize

deskbrid windows minimize 12345678
deskbrid windows maximize 12345678

Protocol:

{"type": "windows.minimize", "window_id": "12345678"}
{"type": "windows.maximize", "window_id": "12345678"}

Move and Resize

deskbrid windows move-resize 12345678 --x 100 --y 100 --width 800 --height 600

Protocol:

{
  "type": "windows.move_resize",
  "window_id": "12345678",
  "x": 100,
  "y": 100,
  "width": 800,
  "height": 600
}

Tile Window

deskbrid windows tile 12345678 --preset left
deskbrid windows tile 12345678 --preset right --padding 10

Presets:

  • left - Left half
  • right - Right half
  • max - Maximize
  • center - Center on screen
  • top-left, top-right, bottom-left, bottom-right

Protocol:

{
  "type": "windows.tile",
  "window_id": "12345678",
  "preset": "left",
  "monitor": 0,
  "padding": 10
}

Activate or Launch

deskbrid windows activate-or-launch code
deskbrid windows activate-or-launch firefox --command ["firefox", "--new-window"]

Protocol:

{
  "type": "windows.activate_or_launch",
  "app_id": "code",
  "command": ["code", "--new-window"],
  "workdir": "/home/user/projects"
}

Workspaces

List Workspaces

deskbrid workspaces list

Protocol:

{"type": "workspaces.list"}

Response:

{
  "type": "response",
  "status": "ok",
  "data": [
    {"id": 1, "name": "1", "focused": true},
    {"id": 2, "name": "2", "focused": false},
    {"id": 3, "name": "3", "focused": false}
  ]
}

Switch Workspace

deskbrid workspaces switch 2

Protocol:

{"type": "workspaces.switch", "workspace_id": 2}

Move Window to Workspace

deskbrid workspaces move-window 12345678 --workspace 3
deskbrid workspaces move-window 12345678 --workspace 3 --follow

Protocol:

{
  "type": "workspaces.move_window",
  "window_id": "12345678",
  "workspace_id": 3,
  "follow": true
}

Python Example

from deskbrid import Deskbrid

client = Deskbrid()

# List and focus VS Code
windows = client.list_windows()
code_window = next((w for w in windows if w.app_id == 'code'), None)
if code_window:
    client.focus_window(app_id='code')
    client.type_text("Fixed the issue!\n")

AI Agent Example

→ {"type": "windows.list"}
← [{"id": "abc123", "title": "VS Code", "app_id": "code", ...}]

→ {"type": "windows.focus", "window_id": "abc123"}
← {"type": "response", "status": "ok"}

→ {"type": "input.keyboard", "action": "type", "text": "git status\n"}

Clone this wiki locally