Convert Figma logo to code with AI

koekeishiya logoyabai

A tiling window manager for macOS based on binary space partitioning

23,088
638
23,088
202

Top Related Projects

7,707

A tiling window manager based on binary space partitioning

9,405

A tiling window manager for X11

A manual tiling window manager for X11

2,355

A modular and extensible wayland compositor

14,396

i3-compatible Wayland compositor

Quick Overview

Yabai is a tiling window manager for macOS that allows users to organize and manage their windows efficiently. It provides a powerful and customizable system for automatically arranging windows in a grid-like layout, enhancing productivity and screen real estate usage.

Pros

  • Highly customizable with extensive configuration options
  • Supports both tiling and floating window management
  • Integrates well with other macOS tools and workflows
  • Active development and community support

Cons

  • Steep learning curve for new users
  • Requires disabling System Integrity Protection (SIP) for full functionality
  • May conflict with some macOS native window management features
  • Limited compatibility with certain applications

Getting Started

  1. Install Homebrew if not already installed:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install Yabai using Homebrew:

    brew install koekeishiya/formulae/yabai
    
  3. Create a basic configuration file:

    mkdir -p ~/.config/yabai
    touch ~/.config/yabai/yabairc
    chmod +x ~/.config/yabai/yabairc
    
  4. Add basic configuration to ~/.config/yabai/yabairc:

    # global settings
    yabai -m config layout bsp
    yabai -m config window_placement second_child
    
    # rules
    yabai -m rule --add app="^System Preferences$" manage=off
    
  5. Start Yabai:

    yabai --start-service
    

For full functionality, follow the instructions in the official documentation to disable System Integrity Protection (SIP) and configure scripting additions.

Competitor Comparisons

7,707

A tiling window manager based on binary space partitioning

Pros of bspwm

  • More lightweight and minimalist approach
  • Highly customizable through simple shell scripts
  • Better support for multi-monitor setups

Cons of bspwm

  • Limited to X11 environments (no Wayland support)
  • Steeper learning curve for configuration
  • Less integrated with macOS-specific features

Code Comparison

bspwm configuration example:

#! /bin/sh

bspc monitor -d I II III IV V VI VII VIII IX X

bspc config border_width         2
bspc config window_gap          12

bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true

yabai configuration example:

# global settings
yabai -m config mouse_follows_focus          off
yabai -m config focus_follows_mouse          off
yabai -m config window_placement             second_child
yabai -m config window_topmost               off
yabai -m config window_opacity               off
yabai -m config window_shadow                on

Both bspwm and yabai are tiling window managers, but they target different operating systems and have distinct approaches. bspwm is designed for Linux systems using X11, while yabai is specifically for macOS. bspwm offers a more minimalist and highly customizable experience, while yabai provides tighter integration with macOS features and a more user-friendly configuration process.

9,405

A tiling window manager for X11

Pros of i3

  • Mature and stable project with a large user base and extensive documentation
  • Highly customizable through a simple configuration file
  • Supports multiple monitors natively

Cons of i3

  • Limited to X11 window system, not compatible with Wayland
  • Less visually appealing default appearance compared to modern desktop environments
  • Steeper learning curve for new users

Code Comparison

i3 configuration example:

bar {
    status_command i3status
    position top
}

bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Shift+q kill

yabai configuration example:

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

i3 focuses on a text-based configuration file, while yabai uses command-line arguments for setup. i3's configuration is more human-readable, but yabai's approach allows for easier programmatic control.

Both projects aim to provide efficient tiling window management, but i3 is designed for Linux systems using X11, while yabai is specifically for macOS. i3 offers a more complete window management solution out of the box, whereas yabai requires additional tools like skhd for full functionality.

A manual tiling window manager for X11

Pros of herbstluftwm

  • More customizable and flexible due to its scriptable nature
  • Supports multiple monitors out of the box
  • Lighter on system resources

Cons of herbstluftwm

  • Steeper learning curve for configuration
  • Less intuitive for macOS users
  • Limited native integration with macOS features

Code Comparison

herbstluftwm configuration example:

hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-w close
hc keybind $Mod-Return spawn ${TERMINAL:-xterm}

yabai configuration example:

yabai -m config layout bsp
yabai -m config top_padding    20
yabai -m config bottom_padding 20
yabai -m config left_padding   20
yabai -m config right_padding  20

Both projects are tiling window managers, but herbstluftwm is designed for X11-based systems (primarily Linux), while yabai is specifically for macOS. herbstluftwm offers more flexibility through its scriptable nature, allowing for complex configurations. yabai, on the other hand, provides a more streamlined experience for macOS users with better integration of native features. The code examples show the difference in configuration syntax, with herbstluftwm using a more verbose approach and yabai using a simpler command-line interface.

2,355

A modular and extensible wayland compositor

Pros of Wayfire

  • Cross-platform compatibility (Linux, FreeBSD)
  • Wayland-based, offering better security and modern graphics stack
  • Highly customizable with plugins and scripting support

Cons of Wayfire

  • Limited to Wayland compositors, not compatible with X11
  • Steeper learning curve for configuration and customization
  • Less mature ecosystem compared to more established window managers

Code Comparison

Wayfire configuration (wayfire.ini):

[core]
plugins = alpha move resize command vswitch oswitch grid

Yabai configuration (yabairc):

yabai -m config layout bsp
yabai -m config top_padding 10

Key Differences

  • Wayfire is a Wayland compositor, while Yabai is a tiling window manager for macOS
  • Wayfire offers a more flexible plugin system, whereas Yabai focuses on tiling and window management
  • Yabai integrates tightly with macOS, while Wayfire provides a more customizable environment across Linux distributions

Use Cases

  • Wayfire: Linux users seeking a modern, customizable desktop environment
  • Yabai: macOS users looking for advanced tiling window management capabilities
14,396

i3-compatible Wayland compositor

Pros of Sway

  • Native Wayland compositor, offering better performance and modern graphics stack support
  • More extensive documentation and larger community support
  • Cross-platform compatibility (Linux, BSD)

Cons of Sway

  • Limited to Wayland-compatible environments
  • Steeper learning curve for configuration and customization
  • Less integration with macOS-specific features

Code Comparison

Sway configuration example:

input "2:14:SynPS/2_Synaptics_TouchPad" {
    dwt enabled
    tap enabled
    natural_scroll enabled
    middle_emulation enabled
}

Yabai configuration example:

yabai -m config layout bsp
yabai -m config top_padding    20
yabai -m config bottom_padding 20
yabai -m config left_padding   20
yabai -m config right_padding  20

Sway focuses on Wayland-specific configurations, while Yabai uses a command-line interface for macOS window management. Sway's config file is more declarative, whereas Yabai relies on shell commands for setup.

Sway offers a complete Wayland compositor solution with broader Linux support, making it suitable for users seeking a full desktop environment replacement. Yabai, on the other hand, is tailored specifically for macOS, providing deep integration with the operating system's window management features.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Banner

Tiling window management for the Mac.

License Badge Documentation Badge Wiki Badge Changelog Badge Version Badge

About

Screenshot

yabai is a window management utility that is designed to work as an extension to the built-in window manager of macOS. yabai allows you to control your windows, spaces and displays freely using an intuitive command line interface and optionally set user-defined keyboard shortcuts using ↗ skhd and other third-party software.

The primary function of yabai is tiling window management; automatically modifying your window layout using a binary space partitioning algorithm to allow you to focus on the content of your windows without distractions. Additional features of yabai include focus-follows-mouse, disabling animations for switching spaces, creating spaces past the limit of 16 spaces, and much more.

Installation and Configuration

  • The ↗ yabai wiki has both brief and detailed installation instructions for multiple installation methods, and also explains how to uninstall yabai completely.
  • Sample configuration files can be found in the ↗ examples directory. Refer to the ↗ documentation or the wiki for further information.
  • Keyboard shortcuts can be defined with ↗ skhd or any other suitable software you may prefer.

Requirements and Caveats

Please read the below requirements carefully. Make sure you fulfil all of them before filing an issue.

RequirementNote
Operating System Intel x86-64Big Sur 11.0.0+, Monterey 12.0.0+, Ventura 13.0.0+, and Sonoma 14.0.0+ is supported.
Operating System Apple SiliconMonterey 12.0.0+, Ventura 13.0.0+, and Sonoma 14.0.0+ is supported.
Accessibility APIyabai must be given permission to utilize the Accessibility API and will request access upon launch. The application must be restarted after access has been granted.
Screen Recordingyabai must be given Screen Recording permission if and only if you want to enable window animations, and will request access when necessary. The application must be restarted after access has been granted.
System Preferences (macOS 11.x, 12.x)In the Mission Control pane, the setting "Displays have separate Spaces" must be enabled.
System Settings (macOS 13.x, 14.x)In the Desktop & Dock tab, inside the Mission Control pane, the setting "Displays have separate Spaces" must be enabled.

Please also take note of the following caveats.

CaveatNote
System Integrity Protection (Optional)System Integrity Protection can be (partially) disabled for yabai to inject a scripting addition into Dock.app for controlling windows with functions that require elevated privileges. This enables control of the window server, which is the sole owner of all window connections, and enables additional features of yabai.
Code SigningWhen building from source (or installing from HEAD), it is necessary to codesign the binary so it retains its accessibility and automation privileges when updated or rebuilt.
Finder DesktopSome people disable the Finder Desktop window using an undocumented defaults write command. This breaks focusing of empty spaces and should be avoided when using yabai. To re-activate the Finder Desktop, run: "defaults write com.apple.finder CreateDesktop -bool true".
NSDocument-based ApplicationsWindows that utilize native macOS tabs such as Terminal and Finder, do not behave correctly when creating tabs. Avoid creating tabs in these applications, consider alternatives that do not use NSDocument's tab system, or make these windows float using rules.
System Preferences (macOS 11.x, 12.x)In the Mission Control pane, the setting "Automatically rearrange Spaces based on most recent use" should be disabled for commands that rely on the ordering of spaces to work reliably.
System Settings (macOS 13.x, 14.x)In the Desktop & Dock tab, inside the Mission Control pane, the setting "Automatically rearrange Spaces based on most recent use" should be disabled for commands that rely on the ordering of spaces to work reliably.
System Settings (macOS 14.x)In the Desktop & Dock tab, inside the Desktop & Stage Manager pane, the setting "Show Items On Desktop" should be enabled for display and space focus commands to work reliably in multi-display configurations.
System Settings (macOS 14.x)In the Desktop & Dock tab, inside the Desktop & Stage Manager pane, the setting "Click wallpaper to reveal Desktop" should be set to "Only in Stage Manager" for display and space focus commands to work reliably.

License and Attribution

yabai is licensed under the ↗ MIT License, a short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.

Thanks to @fools-mate for creating a logo and banner for this project and making them available for free.

Thanks to @dominiklohmann for contributing great documentation, support, and more, for free.

Disclaimer

Use at your own discretion. I take no responsibility if anything should happen to your machine while trying to install, test or otherwise use this software in any form. You acknowledge that you understand the potential risk that may come from disabling ↗ System Integrity Protection on your system, and I make no recommendation as to whether you should or should not disable System Integrity Protection.