Skip to content

Installing yabai (latest release)

Åsmund Vikane edited this page Nov 13, 2020 · 36 revisions

A codesigned binary release of yabai can be installed using Homebrew from the tap koekeishiya/formulae.

brew install koekeishiya/formulae/yabai

Open System Preferences.app and navigate to Security & Privacy, then Privacy, then Accessibility. Click the lock icon at the bottom and enter your password to allow changes to the list. Starting with brew services start yabai will prompt the user to allow yabai accessibility permissions. Check the box next to yabai to allow accessibility permissions.

Now install the scripting addition.

# install the scripting addition
sudo yabai --install-sa

To run yabai, simply start it.

# start yabai
brew services start yabai

In macOS Big Sur we had to switch to using the mach API to inject the scripting addition. Injection now has to run with elevated (root) privileges, meaning that yabai is no longer able to automatically load the scripting addition during startup. However, you can use the following workaround to make it pretty much as seamless as it used to be. The trick is to allow your user to execute yabai --load-sa as the root user without having to enter a password. To do this, we add a new configuration entry that is loaded by /etc/sudoers.

# open/create a new file for writing using the vim editor (use nano or something if you are not familiar with vim)
sudo vim /private/etc/sudoers.d/yabai

# input the line below into the file you are editing.
# replace <user> with your username (output of whoami). 
# change the path to the yabai binary if necessary 
<user> ALL = (root) NOPASSWD: /opt/local/bin/yabai --load-sa

Updating to the latest release

To update yabai to the latest version, simply upgrade it with Homebrew and reinstall the scripting addition:

# stop, and upgrade yabai
brew services stop yabai
brew upgrade yabai

# uninstall the scripting addition
sudo yabai --uninstall-sa

# installing the scripting addition will restart Dock.app
sudo yabai --install-sa

# finally, start yabai
brew services start yabai