Command line
Script your deck from a shell, a hotkey daemon or anything that can run a command.
Basics
All commands go through the same entry point as the app. Run them from the stream-deck folder:
Terminal
$ .venv/bin/python main.py --help
$ .venv/bin/python main.py --list-devices --jsonKeys are addressed by coordinates x,y, starting at 0,0 in the top-left. Decks are addressed by serial number, which --list-devices prints. Every get flag has a matching set.
Examples
Examples
# show the Gaming page on one deck
$ .venv/bin/python main.py --change-page CL123456789 "Gaming"
# press the top-left key on the Main page
$ .venv/bin/python main.py --emulate-input press CL123456789 Main 0,0
# dim the deck at night
$ .venv/bin/python main.py --set-brightness CL123456789 20
# relabel a key without opening the app
$ .venv/bin/python main.py --set-label "Gaming" 0,0 0 center text "Play"All flags
Running
| Flag | What it does |
|---|---|
-b | Start in the background without opening the window. |
--daemon-only | Run without creating the main window until reopened. |
--close-running | Close a running instance. |
--data PATH | Use a different data folder. |
--skip-load-hardware-decks | Don't use connected hardware. Useful for plugin development. |
--devel | Developer mode; disables auto update. |
Reading state
| Flag | What it does |
|---|---|
--list-devices | Connected decks with their serial numbers. |
--list-pages | All pages. |
--list-actions PAGE COORDS STATE | Actions on one key. |
--json | Machine-readable output for list and get commands. |
Controlling a running app
| Flag | What it does |
|---|---|
--change-page SERIAL PAGE | Show a page on a deck. |
--change-state SERIAL PAGE COORDS STATE | Switch a key to another state. |
--emulate-input EVENT SERIAL PAGE COORDS | Act as if a key was pressed. EVENT is press or long-press. |
--get-brightness SERIAL | Current brightness, 0 to 100. |
--set-brightness SERIAL VALUE | Set brightness, 0 to 100. |
--sleep SERIAL | Show the screensaver now. |
--wake SERIAL | Wake from sleep. |
Editing pages (works with the app closed)
| Flag | What it does |
|---|---|
--create-page NAME | New empty page. |
--delete-page NAME | Delete a page. |
--rename-page NAME NEW_NAME | Rename. |
--duplicate-page NAME NEW_NAME | Copy a page. |
--export-page NAME DEST | Export one page with its assets to a .scpage file. |
--export-all DEST | Export every page to a .zip. |
--add-state PAGE COORDS | Add a state to a key. |
--remove-state PAGE COORDS STATE | Remove a state. |
--set-label PAGE COORDS STATE POSITION PROPERTY VALUE | Set label text, font, size, colour, outline or alignment. |
--set-background-color PAGE COORDS STATE COLOR | Colour as R,G,B or R,G,B,A. |
--set-icon PAGE COORDS STATE PATH | Image, GIF or video file for the key. |
--set-icon-layout PAGE COORDS STATE PROPERTY VALUE | Size, alignment or fill mode of the icon. |
D-Bus
The same functions are on the session bus at com.core447.StreamController, for tools that would rather not spawn a process each time.
Questions
Can I control my Stream Deck from a script on Linux?
Yes. StreamController's command line can change pages, press keys, set brightness and edit pages, with JSON output for scripts. It's also available over D-Bus.