yabai

A tiling window manager for macOS based on binary space partitioning

Category
Window Manager
WM Type
tiling
License
free
Open Source
Yes
Keybindings
Yes
Scripting
Yes
Last Update
2026-04-06

Features

  • Binary space partitioning
  • Spaces support
  • Multiple displays
  • Window rules
  • Focus follows mouse
  • Stacking support
  • CLI control

Install

$brew install asmvik/formulae/yabai

About

The most powerful tiling window manager for macOS, using BSP to automatically arrange windows. Extends macOS's window manager with automatic tiling, focus-follows-mouse, and CLI control. Some features require partial SIP disable.

Who It's For

yabai is the tool of choice for developers migrating from Linux tiling environments — if you've built muscle memory around i3, bspwm, or xmonad, yabai offers the closest equivalent on macOS. It's also the right choice when you need programmatic control over window layout: yabai exposes a Unix socket that any script or tool can query and command, enabling automations like "focus the terminal on Space 2 when I switch to my coding layout." The tradeoff is real setup effort, especially if you want cross-space window movement.

How It Works

At its core, yabai hooks into macOS via the Accessibility API (AXUIElement), which lets it query and reposition windows without special privileges. Every new window splits the currently focused window's screen area in half — the binary space partitioning model — recursively building a tree of non-overlapping rectangles. You can tune the split ratio (default 0.5) per window, balance the tree automatically, or switch individual spaces to float or stack mode independently.

The more powerful features — moving windows between spaces, creating and destroying spaces, focus-follows-space — require injecting a scripting addition into the macOS Dock process. This is the step that needs a partial SIP (System Integrity Protection) disable. On Apple Silicon, you reboot into recoveryOS to do this, and must re-run sudo yabai --load-sa after each macOS update.

Configuration

yabai is configured via a shell script executed at startup, at ~/.config/yabai/yabairc:

#!/usr/bin/env sh

yabai -m config layout              bsp
yabai -m config top_padding         10
yabai -m config bottom_padding      10
yabai -m config left_padding        10
yabai -m config right_padding       10
yabai -m config window_gap          8

yabai -m config mouse_follows_focus on
yabai -m config focus_follows_mouse autofocus

# Float apps that don't tile well
yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add app="^Finder$"          manage=off
yabai -m rule --add app="^Alfred$"          manage=off

yabai has no built-in hotkey system — the standard pairing is skhd (brew install asmvik/formulae/skhd), which maps keyboard shortcuts to yabai -m window --focus and similar commands via its own ~/.config/skhd/skhdrc config.

Compared to AeroSpace

AeroSpace is the most direct alternative. The clearest difference: AeroSpace requires no SIP changes because it implements its own virtual workspace system rather than manipulating native macOS Spaces. yabai's approach gives deeper native Spaces integration — you can script space creation and destruction, use tools like SketchyBar that read space state, and move windows to specific spaces by number. AeroSpace trades that depth for a dramatically simpler setup: one TOML config file, built-in keybindings, no companion daemon required. Users who want reliable daily tiling without SIP concerns tend to prefer AeroSpace; those who want maximum scripting control and native Spaces integration choose yabai.

Requirements

  • macOS 11 Big Sur or later (Intel); macOS 12 Monterey or later (Apple Silicon)
  • Accessibility permission required: System Settings → Privacy & Security → Accessibility
  • Partial SIP disable required only for cross-space features (space creation/destruction, moving windows between spaces)
  • On Apple Silicon: must re-run sudo yabai --load-sa after each macOS system update

Getting Started

After installing via Homebrew, make the config executable and pair it with skhd:

# Create and make executable
mkdir -p ~/.config/yabai
touch ~/.config/yabai/yabairc
chmod +x ~/.config/yabai/yabairc

# Install skhd for keybindings
brew install asmvik/formulae/skhd

# Start both services (auto-restart on login via launchd)
yabai --start-service
skhd --start-service

The yabai wiki has the full SIP setup guide for Apple Silicon and Intel, including the sudoers entry that lets yabai reload its scripting addition without a password prompt.

Discussion