A tiling window manager
for macOS.
Scrolling and tiling layouts, emulated workspaces, binding modes and a config in Lua. One command set for the CLI, Lua and URLs.
git clone https://github.com/g4rcez/wm.git && cd wm && ./build-app.sh- macOS 14 or later
- Runs with SIP on
- Configured in Lua
- MIT license
Try it
Press the keys. It moves.
This is a model of wm, not a screen recording. Click the desktop and use the binds from First five minutes: the same commands that wm runs, as you see below the screen.
- Scrolling
- Tiling
- Master-stack
- Tile templates
- Rotate
Features
What you get
Scrolling and tiling
Scrolling puts windows in columns on a strip that moves sideways, as niri and PaperWM do. Tiling splits the screen in a tree, as Hyprland's dwindle layout does. You choose the layout per workspace and change it while wm runs.
wm layout set scrollingEmulated workspaces
wm hides the windows of other workspaces, so it needs no macOS desktops. Name them as you like, and show them on any monitor.
wm workspace webBinding modes
A mode is a separate set of keys. A panel lists the keys that you can press.
wm mode resizeOne command set
The wm CLI, Lua and wm:// URLs run the same commands.
wm.dispatch("focus left")Switcher and overview
A switcher with a picture of each window, and an overview of the workspaces.
wm.bind("alt-tab", "switcher")Command palette
One panel to find windows, apps, browser tabs, wm commands and menu items.
wm.bind("alt-p", "palette")Hints and scroll mode
Click and scroll from the keyboard, as in Homerow.
wm.bind("cmd-shift-space", "hints")Window rules
Match new windows by app or title. Decide where they go and how they look.
wm.rule { app = "com.spotify.client", workspace = "9" }Special workspaces
A scratchpad. One key shows it, the same key hides it.
wm workspace special termConfigure
Your config is a Lua file
~/.config/wm/init.lua is a real program: loops, functions and require work. For a whole file, see the author's configuration, or the config reference.
Gaps, a border, vim keys for focus and workspaces. wm reloads the file when you save it.
wm.config {
layout = "tiling",
gaps = { inner = 8, outer = 8 },
border = { enabled = true, width = 2, active = "#89b4fa" },
}
-- Focus and move with vim keys
wm.bind("alt-h", "focus left --wrap")
wm.bind("alt-j", "focus down --wrap")
wm.bind("alt-k", "focus up --wrap")
wm.bind("alt-l", "focus right --wrap")
wm.bind("alt-shift-h", "swap left")
wm.bind("alt-shift-l", "swap right")
-- alt-N shows workspace N, alt-shift-N sends the window there
for n = 1, 9 do
wm.bind("alt-" .. n, "workspace " .. n)
wm.bind("alt-shift-" .. n, "window send workspace " .. n)
end
wm.bind("alt-f", "window fullscreen")
wm.bind("alt-space", "window float")
wm.bind("alt-s", "layout set scrolling")
wm.bind("alt-t", "layout set tiling")
wm.bind("alt-shift-c", "daemon reload")A resize mode. While it is active, a panel lists its keys with the text from description.
wm.mode("resize", {
h = { "resize width +50", description = "Wider" },
l = { "resize width -50", description = "Narrower" },
j = { "resize height +50", description = "Taller" },
k = { "resize height -50", description = "Shorter" },
esc = { "mode main", description = "Exit" },
})
wm.bind("alt-shift-r", "mode resize")After alt-space, wm waits for the next key (or Escape) and shows the keys that can follow.
local PREFIX = "alt-space>"
wm.bind(PREFIX .. "h", "focus left")
wm.bind(PREFIX .. "l", "focus right")
wm.bind(PREFIX .. "f", "window fullscreen")
wm.bind(PREFIX .. "tab", "switcher")A layout per workspace and per monitor, and rules that place new windows.
wm.workspace("1", { layout = "scrolling" })
wm.workspace("2", { layout = "tiling" })
wm.workspace("web", { monitor = 2, default = true, gaps = { inner = 0, outer = 0 }, border = false })
wm.workspace("code", { layout = "scrolling", monitor = "LG", layout_options = { default_width = 0.7 } })
wm.rule { app = "com.apple.systempreferences", float = true }
wm.rule { app = "net.kovidgoyal.kitty", float = true, size = { 0.62, 0.68 }, center = true }
wm.rule { title = "^Picture in Picture$", float = true }
wm.rule { app = "com.spotify.client", workspace = "9" }React to what happens: a workspace changes, a window opens.
wm.on("workspace_changed", function(e) wm.log("now on workspace " .. e.workspace) end)
wm.on("window_open", { app = "com.apple.finder" }, function(e)
wm.dispatch("window float", { window = e.id })
end)Command line
Script it from the shell
Every key bind is a command, and every command works from the wm CLI, from Lua (wm.dispatch) and from wm:// URLs.
wm list windows # every window, as a table
wm list windows --focused --json # JSON for scripts
wm pick # click a window, get its rule
wm --window app:com.apple.Notes window close # act on a window by app
wm batch 'workspace 2; layout set tiling' # stops at the first error
wm set gaps.inner 4 # until the next reload
wm notify 'build done' --seconds=3 # a message on screenInstall
Three steps
wm has no binary release yet. You build it from source.
- 1
Build
You need macOS 14 and the Swift 6.2 toolchain. The script builds wm.app, signs it and starts it.
./build-app.sh - 2
Grant Accessibility
macOS asks the first time wm starts. Allow it in System Settings > Privacy & Security > Accessibility. wm cannot move windows without it.
- 3
Write your config
Create ~/.config/wm/init.lua. wm has no default keys, so bind your own. See First five minutes.
wm daemon reload
Tile your Mac.
Build it, write ten lines of Lua, and press a key.
git clone https://github.com/g4rcez/wm.git && cd wm && ./build-app.sh