-
-
Notifications
You must be signed in to change notification settings - Fork 6
Features Macros
coe0718 edited this page May 31, 2026
·
2 revisions
Deskbrid's macro system allows you to record and replay sequences of actions. Macros can be recorded in two modes: fast (no delays) or timed (preserves original timing). Macros are stored as JSON files in ~/.local/share/deskbrid/macros/.
Macros capture sequences of deskbrid actions and can replay them later. Each macro has:
- A name for identification
- Creation timestamp
- Mode (fast or timed)
- A list of recorded actions with timestamps (in timed mode)
deskbrid macro.record.start { name: "my-macro" }-
name: Identifier for the macro (required) -
mode: Recording mode - "fast" or "timed" (defaults to "fast")
deskbrid macro.record.stopdeskbrid macro.listResponse:
{
"type": "response",
"status": "ok",
"data": {
"macros": [
{
"name": "my-macro",
"mode": "timed",
"created": "2026-05-30T10:00:00Z",
"actions": 15,
"duration_ms": 2500
},
{
"name": "another-macro",
"mode": "fast",
"created": "2026-05-30T10:05:00Z",
"actions": 8,
"duration_ms": 0
}
]
}
}deskbrid macro.get { name: "my-macro" }Response includes the full macro definition with all recorded actions.
deskbrid macro.replay { name: "my-macro" }
deskbrid macro.replay { name: "my-macro", mode: "fast" } # Override mode-
name: Name of the macro to replay (required) -
mode: Replay mode - "fast" or "timed" (defaults to macro's recorded mode)
deskbrid macro.export { name: "my-macro" }Response:
{
"type": "response",
"status": "ok",
"data": {
"name": "my-macro",
"mode": "timed",
"created": "2026-05-30T10:00:00Z",
"actions": [
{
"type": "windows.list",
"timestamp": 0
},
{
"type": "input.keyboard",
"action": "type",
"text": "Hello, world!",
"timestamp": 150
}
// ... more actions
]
}
}deskbrid macro.import { name: "imported-macro", data: { /* macro JSON from export */ } }-
name: Identifier for the imported macro -
data: The macro JSON object (from export)
deskbrid macro.delete { name: "my-macro" }# Start recording in timed mode (preserves delays)
deskbrid macro.record.start { name: "greeting", mode: "timed" }
# Perform actions that will be recorded
deskbrid windows focus --app code
deskbrid input keyboard type "Hello, world!\n"
deskbrid input mouse move --x 100 --y 200
deskbrid input mouse click --button left
# Stop recording
deskbrid macro.record.stop# Replay preserving original timing
deskbrid macro.replay { name: "greeting" }
# Replay as fast as possible
deskbrid macro.replay { name: "greeting", mode: "fast" }# Export macro to share
deskbrid macro.export { name: "greeting" }
# Save the JSON output to a file and transfer to another system
# Import on another system
deskbrid macro.import {
name: "greeting",
data: { /* the exported JSON */ }
}from deskbrid import Deskbrid
client = Deskbrid()
# Start recording
client.macro_record_start(name="test-macro", mode="timed")
# Perform some actions
client.windows_list()
client.input_keyboard_type("Hello, world!\\n")
# Stop recording
client.macro_record_stop()
# List macros
macros = client.macro_list()
for macro in macros['macros']:
print(f"{macro['name']}: {macro['actions']} actions in {macro['mode']} mode")
# Get a macro
macro = client.macro_get(name="test-macro")
print(f"Macro has {len(macro['data']['actions'])} actions")
# Replay the macro
client.macro_replay(name="test-macro")
# Export for sharing
exported = client.macro_export(name="test-macro")
# saved_json = json.dumps(exported['data'])
# Import (would need the exported JSON)
# client.macro_import(name="imported-macro", data=saved_json)
# Delete when done
client.macro_delete(name="test-macro")- 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