Chunkwm is dead. Reborn as Yabai
Famous tiling window manager on macOS, Yabai is a new window manager created by the same developers as chunkwm, rewrote in C99, added new features, but has some potential risk concerning the System integrity check on macOS. Indeed, the "new" version of Chunkwm has many new features that required to disable the SIP (System Integrity Protection) of macOS. Let's see how to do it.
How? The System Integrity Protection (since macOS 10.13) is a security feature which protects some files and directories from being modified, even if you're the root user.
Why? Yabai needs SIP to be disable in order to inject a scripting addition into Dock.app to access to macOS Window Server. Those scripting addition can perform the modification on windows, spaces and display in a way that only Dock.app could do.
The reason of the deprecation of Chunkwm :
However due to major architectural changes, supported systems, and changes to functionality, it is being released separately. There are multiple reasons behind these changes, based on the experience I've gained through experimenting with, designing, and using both kwmand chunkwm.
Differences between Chunkwm and Yabai
In the following table, I also included the difference with SIP enable/disable. I think that's important, because many users don't want to disable SIP but still wants to know if Yabai can have at least the same features as Chunkwm.
Yabai SIP enable | Yabai SIP disable | Chunkwm | |
---|---|---|---|
Supported macOS version | 10.13–10.15 | 10.13–10.15 | 10.13–10.14 |
General | |||
Plugin API | - | - | ✓ |
Status bar | ✓ | - | - |
Windows | |||
Modify window properties | ✓ | ✓ | ✓ |
Send window to another space | ✓ | ✓ | ✓ |
Remove window shadows | ✓ | - | - |
Enable window transparency | ✓ | - | - |
Control window layers | ✓ | - | - |
Sticky windows | ✓ | - | - |
Move window by clicking in frame | ✓ | - | - |
Spaces | |||
Create and destroy spaces | ✓ | - | ✓ |
Create/destroy space without anim. | ✓ | - | - |
Move space (and its windows) | ✓ | - | - |
Instant space switch | ✓ | - | - |
What if I don't want to disable System Integrity Protection ?
For a simple usage of Yabai (tiling only) which include basics window managements (auto-resize), move windows from space to space, move windows, Yabai still good enough to be installed (especially if you are running on Catalina) and the performance are better than Chunkwm. But all the feature listed on the table above won't be enable.
Status bar
Yabai added the support for a simple status bar (with SIP enable only). You can activate it throw your .yabairc file. If this status bar is too simple for you, you can take a look at Übersicht.
Don't forget to enable the "Automatically hide and show the menu bar" in your macOS system preferences -> General.
Installation
0. Requirements
- Install command line tools :
xcode-select --install
1. Disable SIP (Optional, but you won't have all those new features)
- Reboot your mac
- Hold down
command ⌘ + R
when booting - Utilities -> Terminal
- On macOS 10.13 :
csrutil enable --without debug
- On macOS >= 10.14 :
csrutil enable --without debug --without fs
- Reboot
- You can check the SIP on your terminal with :
csrutil status
2. Install Yabai with Homebrew
More info about the install/uninstall on Github
# clone tap
brew tap koekeishiya/formulae
# install the latest stable version
brew install yabai
# install scripting-addition (will work only if you have SIP disable)
sudo yabai --install-sa
# if macOS Big Sur, load the scripting addition manually; follow instructions below to automate on startup
sudo yabai --load-sa
# default dotfile for yabai
cp /usr/local/opt/yabai/share/yabai/examples/yabairc ~/.yabairc
# default dotfile for skhd
cp /usr/local/opt/yabai/share/yabai/examples/skhdrc ~/.skhdrc
# start yabai as a service
brew services start yabai
After this step, macOS will ask you if you want to give access to Accessibility API for Yabai. System Preferences -> Security & Privacy -> Privacy -> Check Yabai
3. Install SKHD (Keyboard shortcuts)
More info about skhd on Github
# install the latest stable version
brew install koekeishiya/formulae/skhd
# start skhd as a service
brew services start skhd
After this step, macOS will ask you if you want to give access to Accessibility API for skhd. System Preferences -> Security & Privacy -> Privacy -> Check skhd
Configuration
Open your dotfile : ~/.yabairc and start configure it!
If you need some fresh inspiration, take a look at r/unixporn
Credit / sources
- https://github.com/koekeishiya/yabai
- https://www.reddit.com/r/unixporn/comments/ejwab8/darwin_i_wrote_a_nix_module_for_yabai_figured_id/
- https://www.reddit.com/r/unixporn/comments/ehjdsq/yabai_polishing_my_emacs_who_said_an_old_tool/
- https://www.reddit.com/r/unixporn/comments/eh6cm6/yabai_but_would_north_be_true/
- https://www.reddit.com/r/unixporn/comments/djkgvr/yabai_relaxed_osx/
- https://www.reddit.com/r/unixporn/comments/egoaim/yabai_macos_with_custom_übersicht_widgets_and/
- https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)