Caution
Don't use this! Use mikkelricky/yabai/tree/grid-spaces.
Grid spaces a la TotalSpaces2, but for
macOS Monterey, built on
yabai and
skhd. You also need
jq to make the magic work - and jq is a
magic tool in itself!
Install jq:
brew install jqCheck the installation
requirements
for yabai and install it:
brew install yabai --HEAD
yabai --start-serviceCreate the desired number of spaces using yabai or Mission Control.
Make sure that yabai works and can focus spaces by running a command like
yabai --message space --focus nextCreate the file ~/.gridspacesrc and define the number of columns in your grid:
GRID_COLUMNS=3Install skhd:
brew install koekeishiya/formulae/skhd
brew services start skhdCreate or edit the configuration file for skhd and define keyboard shortcuts for moving around in the grid, e.g.
cmd + ctrl - up : «path to this directory»/navigate up
cmd + ctrl - down : «path to this directory»/navigate down
cmd + ctrl - left : «path to this directory»/navigate left
cmd + ctrl - right : «path to this directory»/navigate right
cmd + ctrl + shift - up : «path to this directory»/navigate --move-window up
cmd + ctrl + shift - down : «path to this directory»/navigate --move-window down
cmd + ctrl + shift - left : «path to this directory»/navigate --move-window left
cmd + ctrl + shift - right : «path to this directory»/navigate --move-window rightThat's it! Now you should be able to use your grid.
yabai and Grid spaces only work as expected when some Spaces system
preferences are set correctly:
- “Automatically rearrange Spaces based on most recent use” must not be checked
- “Displays have separate Spaces” must be checked
- “When switching to an application, switch to a Space with open windows for the application” may be checked and might come in handy if you’ve lost a window for an application that you’re onyl use on special occasions.
# Uncheck “Automatically rearrange Spaces based on most recent use”
defaults write com.apple.dock mru-spaces -boolean false
# You may want to check “When switching to an application, switch to a Space with open windows for the application”.
defaults write 'Apple Global Domain' AppleSpacesSwitchOnActivate -boolean true
# Reload the system preferences
killall 'System preferences'Furthermore, all Mission Control space switching keyboard shortcuts should be
disabled as all Space navigation should be handled by skhd calling the
navigate script:
Finally, you may want to Reduce motion to get rid of some animations:
brew reinstall yabai
yabai --restart-servicebrew install shellcheckCheck to code:
shellcheck navigate

