Filter and lay out application windows automatically on macOS using Hammerspoon's window filter and grid modules

domain: hammerspoon.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. In ~/.hammerspoon/init.lua, create a scoped filter with hs.window.filter.new("Slack") (or .new() for a copy of the default filter covering most standard windows)
  2. Subscribe to placement-relevant events, e.g. wf:subscribe(hs.window.filter.windowCreated, function(win) ... end)
  3. Define the partition size with hs.grid.setGrid("3x2"), then snap a window to a cell with hs.grid.set(win, {x=0,y=0,w=1,h=1})
  4. Bind a hotkey to hs.grid.show() for an interactive, keyboard-driven resize/placement mode
  5. Reload the config with hs.reload() or the menu-bar Reload Config option while iterating

Known gotchas

Related routes

Write a Hammerspoon Lua script to reposition and resize the frontmost window on macOS
hammerspoon.org · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans