This setup is honed and tested with the following dependencies.
- macOS Catalina, 10.15.5
- Hammerspoon 0.9.78
-
Clone this repo and then run the script. This will install Hammerspoon and set up all of the configurations.
git clone https://github.com/mikebartGN/window-layout-mode.git ~/.window-layout-mode cd ~/.window-layout-mode script/setup
Quickly arrange and resize windows in common configurations, using keyboard shortcuts. (Feel free to choose your own keyboard shortcuts.)
Use control + s to turn on Window Layout Mode. Then, use any shortcut below to make windows do your bidding. For example, to send the window left, hit control + s, and then hit h.
- Use h to send window left (left half of screen)
- Use j to send window down (bottom half of screen)
- Use k to send window up (top half of screen)
- Use l to send window right (right half of screen)
- Use shift + h to send window to left 40% of screen
- Use shift + l to send window to right 60% of screen
- Use i to send window to upper left quarter of screen
- Use o to send window to upper right quarter of screen
- Use , to send window to lower left quarter of screen
- Use . to send window to lower right quarter of screen
- Use space to send window to center of screen
- Use enter to resize window to fill the screen
- Use n to send window to the next monitor
- Use ← to send window to the monitor on the left (if there is one)
- Use → to send window to the monitor on the right (if there is one)
- Use control + s to exit Window Layout Mode without moving any windows
Window Layout Mode ships with the default keybindings above, but you're welcome to personalize this setup. See hammerspoon/windows-bindings-defaults.lua for instructions on configuring shortcuts to your personal taste.
Window Layout Mode is a functionality extracted from: keyboard
All credit goes to @jasonrudolph


