The command-line tool
In the app, open Help › Integrations and install the chainyourmac command. It's a link at ~/.local/bin/chainyourmac that points into the app, so it stays current with updates. If your shell can't find it, add this line to ~/.zshrc:
export PATH="$HOME/.local/bin:$PATH"
Then run window actions from the terminal, for example:
chainyourmac window focus east
The URL scheme
Every chainyourmac:// URL runs one action. Use open -g so ChainYourMac doesn't come to the front:
open -g "chainyourmac://window/focus/east"
| URL | Does |
|---|---|
chainyourmac://start · stop · restart · toggle | Start, stop or restart the window manager |
…/window/focus/<west|east|north|south|first|last> | Move focus |
…/window/swap/<west|east|north|south|first|last> | Move the focused window |
…/window/center | Centre the focused column |
…/window/resize | Next preset width |
…/window/fullwidth | Toggle full width |
…/window/wider · narrower | Column width |
…/window/taller · shorter · equalize | Heights in a stack |
…/window/stack · unstack | Stack into the left column / out to the right |
…/window/consume/east · expel/west | Stack into the right column / out to the left |
…/window/tabbed | Stacked ↔ tabbed column |
…/window/manage | Float / unfloat |
…/window/nextdisplay | Send to the next display |
…/window/pin/<left|right> | Pin to an edge, or unpin |
URLs are checked against this list before anything reaches the window manager, so a malformed or unknown URL does nothing.
Raycast
Help › Integrations exports Raycast script commands for ChainYourMac's actions. Add them to Raycast's Script Commands and each action is searchable in Raycast, and can have its own hotkey.
Keyboard Maestro, BetterTouchTool, AppleScript
These tools can send ChainYourMac's keyboard shortcuts, and ChainYourMac treats them exactly like keys you type. They can also open the URLs above. That makes it easy to bind actions to a mouse button, a trackpad gesture or a Stream Deck key.
FAQ
Does ChainYourMac work with Raycast?
Yes. Help › Integrations in the app exports Raycast script commands for its actions, and Raycast (like Keyboard Maestro, BetterTouchTool and AppleScript) can also send ChainYourMac's keyboard shortcuts, which work exactly like keys you type.
Can I start or stop ChainYourMac from a script?
Yes: open -g "chainyourmac://stop", chainyourmac://start, chainyourmac://restart or chainyourmac://toggle.