Skip to content

Install & configure dependencies

John Alberts edited this page Oct 26, 2022 · 7 revisions

Install the three core dependencies

First, install yabai, Hammerspoon. 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 install --cask hammerspoon) (getting started guide)

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
  4. Confirm that hs is now available by entering the following in your terminal (shell):
❯ which hs
/usr/local/bin/hs
First, open the hammerspoon console via the menu bar Next, type `hs.ipc.cliInstall()` and hit return

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 →