dotfiles/.config/yabai/yabairc

142 lines
5.6 KiB
Bash
Executable File

#!/bin/sh
## Set PATH
PATH="/opt/homebrew/bin:${PATH}"
## Path to yabai
yabai
## Spaces that should be created
yabai_create_spaces="Main Mail Messaging PIM Shell Code Misc."
## Get nuber of spaces that should be created
yabai_create_spaces_count=$(set -- ${yabai_create_spaces} && echo $#)
## Get number of existing spaces
yabai_spaces=$(yabai -m query --spaces | jq length)
## Global settings
yabai -m config mouse_follows_focus off
yabai -m config focus_follows_mouse off
yabai -m config split_ratio 0.6
yabai -m config window_shadow float
yabai -m config mouse_modifier fn
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
## General space settings
yabai -m config layout bsp
yabai -m config top_padding 10
yabai -m config bottom_padding 10
yabai -m config left_padding 10
yabai -m config right_padding 10
yabai -m config window_gap 10
yabai -m config window_placement second_child
yabai -m config window_opacity on
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.9
## Specific space settings
yabai -m space 1 --layout stack
## Destroy all spaces in reverse order(except of the first one)
i=${yabai_spaces}; while [ ${i} -ne 1 ]; do
yabai -m space ${i} --destroy
i=$((i-1))
done
## Create spaces and label them
i=0; for name in ${yabai_create_spaces}; do
i=$((i+1))
yabai -m space ${i} --label ${name}
if [ ${i} -lt ${yabai_create_spaces_count} ]; then
yabai -m space --create
fi
done
## Sticky Windows
yabai -m rule --add app="^Todoist$" sticky=on
yabai -m rule --add app="^Bitwarden$" sticky=on
space=Main
yabai -m rule --add app="^Firefox$" space="${space}"
yabai -m rule --add app="^Safari$" space="${space}"
yabai -m rule --add app="^Chrome$" space="${space}"
yabai -m rule --add app="^Reeder$" space="${space}"
space=Mail
yabai -m rule --add app="^Mail$" space="${space}"
yabai -m rule --add app="^Thunderbird$" space="${space}"
space=Messaging
yabai -m rule --add app="^Threema$" space="${space}"
yabai -m rule --add app="^WhatsApp$" space="${space}"
yabai -m rule --add app="^Nachrichten$" space="${space}"
space=PIM
yabai -m rule --add app="^Kalender$" space="${space}"
yabai -m rule --add app="^Fantastical$" space="${space}"
yabai -m rule --add app="^Kontakte$" space="${space}"
space=Shell
yabai -m rule --add app="^iTerm2$" space="${space}"
yabai -m rule --add app="^Terminal$" space="${space}"
yabai -m rule --add app="^Alacritty$" space="${space}"
space=Code
yabai -m rule --add app="^VSCodium$" space="${space}"
yabai -m rule --add app="^VSCode$" space="${space}"
yabai -m rule --add app="^Fork$" space="${space}"
space=Misc.
yabai -m rule --add app="^MoneyMoney$" space="${space}"
yabai -m rule --add app="^YNAB$" space="${space}"
yabai -m rule --add app="^Portfolio Performance$" space="${space}"
yabai -m rule --add app="^Affinity .*$" space="${space}"
## Unmanaged applications
yabai -m rule --add app="^App Store$" manage=off
yabai -m rule --add app="^iStat Menus$" manage=off
yabai -m rule --add app="^Bartender .*$" manage=off
yabai -m rule --add app="^Rechner$" manage=off
yabai -m rule --add app="^Numi$" manage=off
yabai -m rule --add app="^Vorschau$" manage=off
yabai -m rule --add app="^System.*einstellungen$" manage=off
yabai -m rule --add app="^System.*informationen$" manage=off
yabai -m rule --add app="^Festplatten.*dienstprogramm$" manage=off
yabai -m rule --add app="^VirtualBox$" manage=off
yabai -m rule --add app="^nextcloud$" manage=off
yabai -m rule --add app="^Hazel$" manage=off
yabai -m rule --add app="^Color Picker$" manage=off
yabai -m rule --add app="^ColorSlurp$" manage=off
yabai -m rule --add app="^PrinterProxy$" manage=off
yabai -m rule --add app="^ExactScan Pro$" manage=off
yabai -m rule --add app="^coconutBattery$" manage=off
yabai -m rule --add app="^Arq$" manage=off
yabai -m rule --add app="^The Unarchiver$" manage=off
yabai -m rule --add app="^VMware Fusion$" manage=off
yabai -m rule --add app="^Passepartout$" manage=off
yabai -m rule --add app="^FaceTime$" manage=off
## Unmanaged windows of specific applications
yabai -m rule --add app="^Alfred Preferences$" manage=off
yabai -m rule --add app="^Thunderbird$" title="(Nachricht wird gesendet|Aktivitäten|Öffnen von)" manage=off
yabai -m rule --add app="^MoneyMoney$" title="(Einstellungen)" manage=off
yabai -m rule --add app="^DBeaver$" title="(Treibereinstellungen|Neue Verbindung anlegen)" manage=off
yabai -m rule --add app="^Fantastical Helper$" manage=off
yabai -m rule --add app="^Affinity .*$" title="(Dokument)" manage=off
yabai -m rule --add app="^Fantastical$" title="(Allgemein|Darstellung|Accounts|Kalender|Erinnerungen|Wetter|Erweitert|Aktualisieren)" manage=off
yabai -m rule --add app="^Finder$" title="(Kopieren|Bewegen|Verbinden|Infos|Einstellungen|Über|Papierkorb)" manage=off
yabai -m rule --add app="^FileBot$" title="(Invalid Characters|Preset Editor|Conflicts|TheTVDB|TheMovieDB|AccoustID)" manage=off
yabai -m rule --add app="^Fork$" title="(General|Commit|Git|Integration|Custom Commands|Updates)" manage=off
yabai -m rule --add app="^Mail$" title="(Accountinformationen|Aktivität|Allgemein|Accounts|Spam|Schrift & Farbe|Darstellung|Verfassen|Signaturen|Regeln)" manage=off
echo "yabai configuration loaded.."
# This downloads an up-to-date version of the yabai autoupdate script hosted by @dominiklohmann and executes it whenever yabai starts.
YABAI_CERT=yabai-cert sh -c "$(curl -fsSL "https://git.io/update-yabai")" &