Skip to content

Install & configure dependencies

Adam Wagner edited this page Nov 28, 2020 · 9 revisions

Install the three core dependencies

First, install yabai, Hammerspoon, and jq. More information about how to set up each dependency can be found in the respective repository.

  1. https://github.com/koekeishiya/yabai (brew install yabai) (install guide)
  2. https://github.com/Hammerspoon/hammerspoon (brew cask install hammerspoon) (getting started guide)
  3. https://github.com/stedolan/jq (brew install jq)

Install the Hammerspoon cli tool

  1. Ensure Hammerspoon is running
  2. Open the hammerspoon console via the menu bar
  3. Type hs.ipc.cliInstall() and hit return
First, open the hammerspoon console via the menu bar Next, type `hs.ipc.cliInstall()` and hit return

Finally confirm that hs is now available by entering the following in your terminal (shell):

❯ which hs
/usr/local/bin/hs

If the of which hs is /usr/local/bin/hs, then the Hammerspoon cli is correctly installed!


Configure yabai stacks

You're free to bind yabai commands using your favorite key remapper tool (skhd, Karabiner Elements, and even Hammerspoon are all viable options).

That said, you're probably using skhd.

If so, now is a good time to map keys for navigating and manipulating yabai stacks:

# Focus window up/down in stack
ctrl - n : yabai -m window --focus stack.next
ctrl - p : yabai -m window --focus stack.prev

# Add the active window  to the window or stack to the {direction}
# Note that this only works when the active window does *not* already belong to a stack
cmd + ctrl - left  : yabai -m window west --stack $(yabai -m query --windows --window | jq -r '.id')
cmd + ctrl - down  : yabai -m window south --stack $(yabai -m query --windows --window | jq -r '.id')
cmd + ctrl - up    : yabai -m window north --stack $(yabai -m query --windows --window | jq -r '.id')
cmd + ctrl - right : yabai -m window east --stack $(yabai -m query --windows --window | jq -r '.id')

Next: Install stackline →