Blazing Fast Window Management on macOS
An overview of how to manage macOS windows and desktops at blazing speeds!
Here is my yabai configuration (.yabairc
)
#!/usr/bin/env sh
sudo yabai --load-sayabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# global settingsyabai -m config mouse_follows_focus offyabai -m config focus_follows_mouse offyabai -m config window_origin_display defaultyabai -m config window_placement second_childyabai -m config window_topmost offyabai -m config window_shadow onyabai -m config window_opacity offyabai -m config window_opacity_duration 0.0yabai -m config active_window_opacity 1.0yabai -m config normal_window_opacity 0.90yabai -m config window_border offyabai -m config window_border_width 6yabai -m config active_window_border_color 0xff775759yabai -m config normal_window_border_color 0xff555555yabai -m config insert_feedback_color 0xffd75f5fyabai -m config split_ratio 0.50yabai -m config auto_balance offyabai -m config mouse_modifier fnyabai -m config mouse_action1 moveyabai -m config mouse_action2 resizeyabai -m config mouse_drop_action swap
# general space settingsyabai -m config layout bspyabai -m config top_padding 15yabai -m config bottom_padding 15yabai -m config left_padding 15# NOTE: for OBS floating head# yabai -m config left_padding 450yabai -m config right_padding 15yabai -m config window_gap 15
# apps to not manage (ignore)yabai -m rule --add app="^System Settings$" manage=offyabai -m rule --add app="^Archive Utility$" manage=offyabai -m rule --add app="^Wally$" manage=offyabai -m rule --add app="^Pika$" manage=offyabai -m rule --add app="^balenaEtcher$" manage=offyabai -m rule --add app="^Creative Cloud$" manage=offyabai -m rule --add app="^Logi Options$" manage=offyabai -m rule --add app="^Alfred Preferences$" manage=offyabai -m rule --add app="Raycast" manage=offyabai -m rule --add app="^Music$" manage=off
echo "yabai configuration loaded.."
This is my skhd configuration (.skhdrc
)
# focus windowalt - h : yabai -m window --focus westalt - j : yabai -m window --focus southalt - k : yabai -m window --focus northalt - l : yabai -m window --focus east
# swap managed windowshift + alt - h : yabai -m window --swap westshift + alt - j : yabai -m window --swap southshift + alt - k : yabai -m window --swap northshift + alt - l : yabai -m window --swap east
# move managed windowshift + alt + ctrl - h : yabai -m window --warp westshift + alt + ctrl - j : yabai -m window --warp southshift + alt + ctrl - k : yabai -m window --warp northshift + alt + ctrl - l : yabai -m window --warp east
# rotate treealt - r : yabai -m space --rotate 90
# toggle window fullscreen zoomalt - f : yabai -m window --toggle zoom-fullscreen
# alt - s : yabai -m window --togglealt - s : yabai -m window --toggle sticky;\ yabai -m window --toggle topmost;\ yabai -m window --toggle pip
# toggle padding and gapalt - g : yabai -m space --toggle padding; yabai -m space --toggle gap
# float / unfloat window and center on screenalt - t : yabai -m window --toggle float;\ yabai -m window --grid 4:4:1:1:2:2
# toggle window split typealt - e : yabai -m window --toggle split
# balance size of windowsshift + alt - 0 : yabai -m space --balance
# move window and focus desktopshift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4shift + alt - 5 : yabai -m window --space 5; yabai -m space --focus 5shift + alt - 6 : yabai -m window --space 6; yabai -m space --focus 6shift + alt - 7 : yabai -m window --space 7; yabai -m space --focus 7shift + alt - 8 : yabai -m window --space 8; yabai -m space --focus 8shift + alt - 9 : yabai -m window --space 9; yabai -m space --focus 9
# create desktop, move window and follow focus - uses jq for parsing json (brew install jq)shift + alt - n : yabai -m space --create && \ index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')" && \ yabai -m window --space "${index}" && \ yabai -m space --focus "${index}"
# fast focus desktopalt - tab : yabai -m space --focus recent
# send window to monitor and follow focusshift + alt - n : yabai -m window --display next; yabai -m display --focus nextshift + alt - p : yabai -m window --display previous; yabai -m display --focus previous
Resources
Additional Links
Update: In macOS Ventura, it has been moved to a “Mission Control” dropdown in the keyboard shortcut section.
Sign-Up for New Posts
Stay in the loop and get the latest blog posts about dotfiles sent to your inbox.
Or use the
RSS Feed