swm
A client and daemon for scriptable macOS window management.
Covers swm v0.0.36, checked on 24 November 2026.
swm is a window manager you drive from the shell. One swm process runs as a daemon and keeps track of applications, displays, Spaces, and windows. Every other swm invocation sends one command to that daemon and prints the result.
Tiling is optional. Keep the default floating layout and bind swm commands to keys to move and focus windows, or give a Space the master, monocle, or dwindle layout and let swm arrange it.
swm borrows ideas from yabai. It replaces the JavaScript configuration of its predecessor, Stark, with shell commands.
This reference covers v0.0.36. Read the upgrade guide before updating existing scripts.
Start here #
- Install swm and start the daemon, then grant Accessibility permission.
- Learn how commands work and query what swm can see.
- Move and focus windows, or choose a tiling layout for a Space.
- Save your settings and window rules in
swmrcso the daemon applies them at startup.
Requirements #
- macOS 26 or later
- Accessibility permission for
swm - A Swift 6.4 toolchain and the macOS SDK when building from source
swm uses private macOS frameworks. A macOS update can change behaviour that it depends on.
Try it #
Install swm and start the daemon:
brew install starkwm/formulae/swm
brew services start swm
Follow the Accessibility permission instructions, then, from any terminal:
swm query windows
swm config layout dwindle
swm window focus right
The first command prints every window swm tracks as JSON. The second tiles every current and future Space with the dwindle layout. The third focuses the nearest window to the right. Run swm config layout float to stop tiling.
Use it with other tools #
swm does not bind keys. Use skbd or another hotkey daemon to run its commands, as shown in keyboard shortcuts.
If stags manages the same windows, keep swm on the floating layout. Automatic tiling can move windows that stags has parked back on screen.
