feat: simplify yabai setup

This commit is contained in:
winston 2022-10-11 06:12:25 +02:00
parent 4ed2f889f4
commit 3a351a7014
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 47 additions and 60 deletions

View file

@ -21,7 +21,7 @@ cmd + shift - l : yabai -m window --warp east
cmd + shift - s: yabai -m window --toggle sticky; yabai -m window --toggle border cmd + shift - s: yabai -m window --toggle sticky; yabai -m window --toggle border
cmd + shift - d: yabai -m window --toggle float cmd + shift - d: yabai -m window --toggle float
cmd + shift - return : wezterm-gui start cmd + shift - return : open -na "WezTerm"
cmd - f2 : open -na "Firefox" cmd - f2 : open -na "Firefox"
# open Ranger # open Ranger
cmd - f3 : wezterm start ranger $HOME cmd - f3 : wezterm start ranger $HOME

View file

@ -3,85 +3,72 @@
# Link to skhrc for <g-f>: ~/.config/skhd/skhdrc # Link to skhrc for <g-f>: ~/.config/skhd/skhdrc
# when SIP is disabled {{{
sudo yabai --load-sa sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# ensure that there are always 10 spaces # ensure that there are always 10 spaces
spacestocreate=$((10 - $(yabai -m query --spaces | jq length))) spacestocreate=10
while [ "$spacestocreate" -gt 0 ]; do spaces=$((spacestocreate - $(yabai -m query --spaces | jq length)))
while [ "$spaces" -gt 0 ]; do
yabai -m space --create yabai -m space --create
spacestocreate=$((spacestocreate - 1)) spaces=$((spaces - 1))
done done
# }}}
# apps which should yabai -m config \
# - not be managed mouse_follows_focus off \
# - not stick focus_follows_mouse off \
# - a layer above mouse_modifier fn \
mouse_action1 move \
mouse_action2 resize \
mouse_drop_action swap \
window_origin_display default \
window_placement second_child \
active_window_border_color 0xfff5c2e7 \
normal_window_border_color 0xffb4befe \
insert_feedback_color 0xfff9e2af \
window_border on \
window_border_width 2 \
window_opacity on \
window_opacity_duration 0.1 \
normal_window_opacity 1.0 \
window_shadow float \
auto_balance off \
split_ratio 0.50 \
layout bsp \
top_padding 5 \
bottom_padding 5 \
left_padding 5 \
right_padding 5 \
window_gap 5 \
window_animation_duration 0.1 \
external_bar all:32:0
APPS_ABOVE=( APPS_ABOVE=(
"JetBrains Toolbox" "JetBrains Toolbox"
"Mullvad VPN" "Mullvad VPN"
"Sip" "Sip"
"iStat Menus Status" "iStat Menus Status"
) )
for app in "${APPS_ABOVE[@]}"; do
yabai -m rule --add app="^$app\$" manage=off sticky=off layer=above border=off
done
APPS_UNMANAGED=( APPS_UNMANAGED=(
"CleanShot X" "CleanShot X"
"System Preferences" "System Preferences"
) )
# special rules for windows/apps
for app in "${APPS_ABOVE[@]}"; do
yabai -m rule --add app="^$app\$" manage=off sticky=off layer=above border=off
done
for app in "${APPS_UNMANAGED[@]}"; do for app in "${APPS_UNMANAGED[@]}"; do
yabai -m rule --add app="^$app\$" manage=off border=off yabai -m rule --add app="^$app\$" manage=off border=off
done done
# global settings APPS_OPACITY=(
# MOUSE FOCUS: useless when SIP is enabled, borked when disabled. "Alacritty"
# yabai -m config mouse_follows_focus on "kitty"
# yabai -m config focus_follows_mouse on "WezTerm"
"wezterm-gui"
)
for app in "${APPS_OPACITY[@]}"; do
yabai -m rule --add app="^$app\$" opacity=0.95
done
# MOUSE MODIFIER: this actually works, wewlad. echo "$(date -Iseconds): [RELOAD] finished loading yabai conf"
# shit experience though, since CMD + click is commonly used throughout apps.
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
# a sad imitation of i3
yabai -m config window_origin_display default
yabai -m config window_placement second_child
# keep this turned off if you want to take screenshots...
# -> https://github.com/koekeishiya/yabai/discussions/1079
#yabai -m config window_topmost off
# welcome to the ricefields, motherfucker
yabai -m config active_window_border_color 0xfff5c2e7
yabai -m config normal_window_border_color 0xffb4befe
yabai -m config insert_feedback_color 0xfff9e2af
yabai -m config window_border on
yabai -m config window_border_width 4
yabai -m config window_opacity off
# SIP disabled only? FeelsBadMan
yabai -m config window_shadow float
# other shit
yabai -m config auto_balance off
yabai -m config split_ratio 0.50
# 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
yabai -m config right_padding 5
yabai -m config window_gap 5
yabai -m config window_animation_duration 0
# for sketchybar, add a 32 rel px gap on the top
yabai -m config external_bar all:32:0
printf "\n\n\nRELOAD: finished loading yabai conf\n"