dotfiles/dot_config/yabai/executable_yabairc

76 lines
3.6 KiB
Bash

#!/usr/bin/env sh
# necessary to load scripting-addition during startup on macOS Big Sur
# *yabai --load-sa* is configured to run through sudo without a password
sudo yabai --load-sa
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
# mission-control desktop labels
yabai -m space 1 --label code
yabai -m space 2 --label mail
yabai -m space 3 --label web
yabai -m space 4 --label notes
yabai -m space 5 --label re
yabai -m space 6 --label media
yabai -m space 7 --label social
yabai -m space 8 --label games
# window rules
yabai -m rule --add app="^Mail$" space=mail
yabai -m rule --add app="^Safari$" space=web
yabai -m rule --add app="^Notes$" space=notes
yabai -m rule --add app="^ida64$" space=re
yabai -m rule --add app="^Transmission$" space=media
yabai -m rule --add app="^Spotify$" space=media
yabai -m rule --add app="^Discord$" space=social grid=1:1:0:0:1:1 manage=off
yabai -m rule --add app="^Steam$" space=games manage=off
yabai -m rule --add app="^(Calculator|System Preferences|Archive Utility)$" manage=off
yabai -m rule --add app="^mpv$" manage=off border=off sticky=on layer=above opacity=1.0 grid=8:8:6:0:2:2
# signals
yabai -m signal --add event=window_destroyed active=yes action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse &> /dev/null || yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id) &> /dev/null"
yabai -m signal --add event=window_minimized active=yes action="if \$(yabai -m query --windows --window \$YABAI_WINDOW_ID | jq -r '.\"is-floating\"'); then yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse &> /dev/null || yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id) &> /dev/null; fi"
# specific space settings
yabai -m config --space mail layout stack
yabai -m config --space games layout float
# global settings
yabai -m config \
mouse_follows_focus off \
focus_follows_mouse autoraise \
window_origin_display default \
window_placement second_child \
window_zoom_persist on \
window_topmost off \
window_shadow on \
window_animation_duration 0.0 \
window_animation_frame_rate 120 \
window_opacity_duration 0.0 \
active_window_opacity 1.0 \
normal_window_opacity 0.90 \
window_opacity off \
insert_feedback_color 0xffd75f5f \
active_window_border_color 0xff775759 \
normal_window_border_color 0xff555555 \
window_border_width 4 \
window_border_radius 12 \
window_border_blur off \
window_border_hidpi on \
window_border off \
split_ratio 0.50 \
split_type auto \
auto_balance off \
top_padding 12 \
bottom_padding 12 \
left_padding 12 \
right_padding 12 \
window_gap 06 \
layout bsp \
mouse_modifier fn \
mouse_action1 move \
mouse_action2 resize \
mouse_drop_action swap
echo "yabai configuration loaded.."