Redefining macOS Screen Space: A Guide to Yabai Window Management

Discover the secrets of enhanced macOS window management with Yabai, SKHD, and Übersicht. Revolutionize your Mac operations, boost efficiency, and retain that signature Apple elegance. While macOS dazzles with its design, its window management leaves some desiring more. Yabai, paired with SKHD and Übersicht, elevates window functionalities. Master the integration of these tools for a streamlined experience and unparalleled multitasking prowess
Redefining macOS Screen Space: A Guide to Yabai Window Management

Apple’s macOS operating system is a beautiful amalgamation of art and functionality, a tribute to the designers who brought UNIX to the masses, encased in an exceptionally user-friendly interface. The aesthetic appeal and seamless inter-application operability are some of the key factors that make macOS the preferred choice for a significant demographic.

That said, for all its user-centric design and features, macOS isn’t perfect, especially in the realm of window management. The recurring user challenge, that the system is not fully optimized for intense work, could often lead to a clutter of overlapping windows, especially when an external display is not in use. The active windows in macOS lack obvious highlighting, making them a potential stumbling block in a user’s workflow.

To address this, a delightful workaround has emerged in the form of Yabai - a next-generation window management tool that offers plentiful solutions to the most tedious macOS issues.

Why Yabai?

Yabai is a window tiling manager that cleverly addresses the window management shortcomings in macOS. Using a logic-based window arrangement, Yabai organizes applications into non-overlapping frames of the screen partition, making it possible for users to utilize their screen’s real estate to the fullest.

By enabling a user to easily view, interact or switch between multiple applications simultaneously, Yabai enhances productivity levels. This tool can be customized to the user’s workflow making Yabai truly the much-needed extension for macOS users.

How to Install Yabai, SKHD, and Übersicht?

As impressive as Yabai is by itself, adding SKHD and Übersicht to the mix further refines the user experience.

SKHD (Simple HotKey Daemon) is a hotkey daemon allowing users to manage Yabai through keyboard shortcuts, while Übersicht is a tool to customize the look of your desktop.

Here’s a simple guide to installing these tools and a basic configuration suggestion:

Step 1. Install Homebrew

Open Terminal and paste the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Step 2. Install Yabai

In Terminal:

brew install koekeishiya/formulae/yabai

Create a empty config file for yabai:

mkdir .config/yabai
touch .config/yabai/yabairc

Edit the config file with nano:

nano .config/yabai/yabairc

Copy and paste the following basic configuration into the file:

# default layout (can be bsp, stack or float)
yabai -m config layout bsp

# padding set to 12px
yabai -m config top_padding 12
yabai -m config bottom_padding 12
yabai -m config left_padding 12  
yabai -m config right_padding 12 
yabai -m config window_gap 12    
yabai -m config external_bar all:28:0

# center mouse on window with focus
yabai -m config mouse_follows_focus on

# modifier for clicking and dragging with mouse
yabai -m config mouse_modifier alt
# set modifier + left-click drag to move window
yabai -m config mouse_action1 move
# set modifier + right-click drag to resize window
yabai -m config mouse_action2 resize


# when window is dropped in center of another window, swap them (on edges it will split it)
yabai -m mouse_drop_action swap

yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add app="^Calculator$" manage=off
yabai -m rule --add app="^Karabiner-Elements$" manage=off

# Space Naming
yabai -m space 1 --label "First Space Name"
yabai -m space 2 --label "Second Space Name"
yabai -m space 3 --label "Third Space Name"

yabai -m config mouse_follows_focus          off
yabai -m config focus_follows_mouse          on 
yabai -m config window_topmost               on 

Save your config and exit nano:

[CTRL] + o + [ENTER]
[CTRL] + x

To make Yabai start by default, paste the following:

yabai --install-service
yabai --start-service

Grant requested permissions

Step 3. Install SKHD

In Terminal:

brew install koekeishiya/formulae/skhd

Create a empty config file for SKHD:

mkdir .config/skhd
touch .config/skhd/yabairc

Edit the config file with nano:

nano .config/skhd/skhdrc

Copy and paste the following basic configuration into the file:

# change window focus within space
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - h : yabai -m window --focus west
alt - l : yabai -m window --focus east

#change focus between external displays (left and right)
alt - s: yabai -m display --focus west
alt - g: yabai -m display --focus east

# rotate layout clockwise
shift + alt - r : yabai -m space --rotate 270

# flip along y-axis
shift + alt - y : yabai -m space --mirror y-axis

# flip along x-axis
shift + alt - x : yabai -m space --mirror x-axis

# toggle window float
shift + alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2

# maximize a window
shift + alt - m : yabai -m window --toggle zoom-fullscreen

# balance out tree of windows (resize to occupy same area)
shift + alt - e : yabai -m space --balance

# swap windows
shift + alt - j : yabai -m window --swap south
shift + alt - k : yabai -m window --swap north
shift + alt - h : yabai -m window --swap west
shift + alt - l : yabai -m window --swap east

# move window and split
ctrl + alt - j : yabai -m window --warp south
ctrl + alt - k : yabai -m window --warp north
ctrl + alt - h : yabai -m window --warp west
ctrl + alt - l : yabai -m window --warp east

# move window to display left and right
shift + alt - s : yabai -m window --display west; yabai -m display --focus west;

Save your config and exit nano:

[CTRL] + o + [ENTER]
[CTRL] + x

For SKHD to start by default:

  
skhd --install-service
skhd --start-service

Grant requested permissions.

Step 4. Install Übersicht

Visit the Übersicht repository and download the tool.

Download and install “Simple Bar” from Jean Tinland by following the instructions in his github repository

Start Übersicht and grant requested permissions.

Note: You might check if Übersicht is part of your startup in macOS at System Settings.

Step 5

Once these tools are installed, you can configure them to your liking.

Final note: Installations above do not cover the advanced configurations for Yabai, SKHD, or Übersicht. They are vast and highly customizable tools that heavily depend on how you want them to optimize your macOS environment.

Wrap Up

While macOS has revolutionized user experience in numerous ways, as a UNIX-like system, it does lack in a few aspects like window management. The combination of Yabai, SKHD, and Übersicht fills in this gap, giving further power to the users to refine their computing experience.

Tweaking software to fit your needs and tastes is what makes computing personal. Take advantage of these tools, and may Yabai be a stepping stone to a more efficient and productive workflow on your Mac!

In summary, despite the few drawbacks, macOS still brings a seamless user experience to the computationally demanding public. And with tools like Yabai, SKHD, and Übersicht, the experience only gets better. Ultimately, the customization ability is macOS users’ and these tools can be exploited to tailor the system to their precise needs, making it a truly personal computing experience.

Header Photo by Lukas Helleberand on Unsplash