Skip to content

jbarreto/grid-spaces

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

Installation

Install jq:

brew install jq

Check the installation requirements for yabai and install it:

brew install yabai --HEAD
brew services start koekeishiya/formulae/yabai

Create 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 next

Create the file ~/.gridspacesrc and define the number of columns in your grid:

GRID_COLUMNS=3

Install skhd:

brew install koekeishiya/formulae/skhd
brew services start skhd

Create 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 right

That's it! Now you should be able to use your grid.

System preferences

yabai and Grid spaces only work as expected when some Spaces system preferences are set correctly:

System Preferences: Set up spaces

  • “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.

Furthermore, all Mission Control space switching keyboard shortcuts should be disabled as all Space navigation should be handled by skhd calling the navigate script:

System Preferences: Mission Control space switching keyboard shortcuts

Finally, you may want to Reduce motion to get rid of some animations:

System Preferences: Reduce motion

Updating

brew reinstall yabai
brew services stop koekeishiya/formulae/yabai
sudo yabai --uninstall-sa
sudo yabai --install-sa
brew services start koekeishiya/formulae/yabai

Coding standards

Install ShellCheck:

brew install shellcheck

Check the code:

shellcheck navigate

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%