Skip to content

Instantly share code, notes, and snippets.

@shreewatsa
Created March 15, 2023 07:25
Show Gist options
  • Save shreewatsa/420e188529b0556b9e2734c4fe42bb11 to your computer and use it in GitHub Desktop.
Save shreewatsa/420e188529b0556b9e2734c4fe42bb11 to your computer and use it in GitHub Desktop.
MacOS: Yabai Configuration File aka yabairc

Config File Location: ~/.config/yabai/yabairc

#!/usr/bin/env sh

yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa


# global settings
yabai -m config mouse_follows_focus          off
yabai -m config focus_follows_mouse          off
yabai -m config window_origin_display        default
yabai -m config window_placement             second_child
yabai -m config window_topmost               off
yabai -m config window_shadow                on
yabai -m config window_opacity               off
yabai -m config window_opacity_duration      0.0
yabai -m config active_window_opacity        1.0
yabai -m config normal_window_opacity        0.90
yabai -m config window_border                on
yabai -m config window_border_width          2
# 0xED2B33FF, ADEFD1FF
yabai -m config active_window_border_color   0xFF40FF00
yabai -m config normal_window_border_color   0x00FFFFFF
yabai -m config insert_feedback_color        0xD6ED17FF
yabai -m config split_ratio                  0.50
yabai -m config auto_balance                 off
yabai -m config mouse_modifier               fn
yabai -m config mouse_action1                move
yabai -m config mouse_action2                resize
yabai -m config mouse_drop_action            swap

# general space settings
yabai -m config layout                       bsp
yabai -m config top_padding                  5
yabai -m config bottom_padding               5
yabai -m config left_padding                 5
# NOTE: for OBS floating head
# yabai -m config left_padding                 450
yabai -m config right_padding                5
yabai -m config window_gap                   5

# apps to not manage (ignore)
yabai -m rule --add title="^mylauncher$" manage=off sticky=on layer=above border=off
yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add app="^Archive Utility$" manage=off
yabai -m rule --add app="^Wally$" manage=off
yabai -m rule --add app="^Pika$" manage=off
yabai -m rule --add app="^balenaEtcher$" manage=off
yabai -m rule --add app="^Creative Cloud$" manage=off
yabai -m rule --add app="^Logi Options$" manage=off
yabai -m rule --add app="^Alfred Preferences$" manage=off
yabai -m rule --add app="Raycast" manage=off
yabai -m rule --add app="^Music$" manage=off

echo "yabai configuration loaded.."

#    Alpha  	Hex   Num
#     100%	  FF    255
#     95%     F2    242
#     90%     E6    230
#     85%     D9    217
#     80%     CC    204
#     75%     BF    191
#     70%     B3    179
#     65%     A6    166
#     60%     99    153
#     55%     8C    140
#     50%     80    128
#     45%     73    115
#     40%     66    102
#     35%     59    89
#     30%     4D    77
#     25%     40    64
#     20%     33    51
#     15%     26    38
#     10%     1A    26
#     5%      0D    13
#     0%      00    0
#

## What do I want from a tiling window manager ?
# Displays > Workspaces > Windows.
# 1. Window movements.
#   1.1 Float the window, tile the window.
#   1.2 Move window to nth workspace.
#   1.3 Move window to left and right workspace.
#   1.4 Move the window to another display.
#   1.5 Mark windows, and move to last window.
#   1.6 Toggle view on multiple windows of the same application.
# 2. Resizing windows.
#   2.1 Increase / Decrease the window size - width only
#   2.2 Reset the window size to default value.
#   2.3 Full screen toggle.
# 3. Tiling layout.
#   3.1 Choose full/tab screen tiling layout.
#   3.2 Choose binary partition screen tiling layout.
#   3.3 Refresh the tiling layout.
#   3.4 Configure specific window to tile in specific way ie floating.
#   3.5 Choose specific window to open in specific workspace, at specific window size.
#   3.6 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment