-
-
Notifications
You must be signed in to change notification settings - Fork 651
Installing yabai (latest release)
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
# if macOS Big Sur or Monterey, load the scripting addition manually; follow instructions below to automate on startup
sudo yabai --load-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.
# create a new file for writing - visudo uses the vim editor by default.
# go read about this if you have no idea what is going on.
sudo visudo -f /private/etc/sudoers.d/yabai
# input the line below into the file you are editing.
# replace <yabai> with the path to the yabai binary (output of: which yabai).
# replace <user> with your username (output of: whoami).
# replace <hash> with the sha256 hash of the yabai binary (output of: shasum -a 256 $(which yabai)).
# this hash must be updated manually after running brew upgrade.
<user> ALL = (root) NOPASSWD: sha256:<hash> <yabai> --load-sa
After the above edit has been made, simply add the command to load the scripting addition to the top of your yabairc config file
# the scripting-addition must be loaded manually if
# you are running yabai on macOS Big Sur. Uncomment
# the following line to have the injection performed
# when the config is executed during startup.
#
# for this to work you must configure sudo such that
# it will be able to run the command without password
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# .. more yabai startup stuff
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
This wiki is a community–driven documentation page. If you want to request a topic for this wiki to address or discuss its content, head over to issue #5.
General
Installation
Configuration
Commands
Tips and Tricks
- Quickly restart the yabai launch agent
- Split yabai configuration across multiple files
- Fix spaces reordering automatically
- Fix folders opened from Desktop not tiling
- Auto updating from HEAD via brew
- Tiling Emacs
- Flash highlight to identify focused window
- Constrain space focus to current display with optional cycling