Add yabai and skhd, this isnt fully working yep, also need to look into how to automate the yabai hash after an upgr via brew

This commit is contained in:
Martin Larsson 2024-01-20 01:34:34 +01:00
parent fdb6bcf4ad
commit e0cf2e4865
3 changed files with 104 additions and 0 deletions

58
skhd/skhdrc Normal file
View file

@ -0,0 +1,58 @@
### Yabai
# Window focus
alt - n : yabai -m window --focus next || yabai -m window --focus first
alt - e : yabai -m window --focus prev || yabai -m window --focus last
# Display focus (currently only running one)
# : yabai -m window --focus recent
# : yabai -m window --focus prev
# : yabai -m window --focus next
# : yabai -m window --focus 2
# Space focus
alt - h : yabai -m space --focus prev || yabai -m space --focus last
alt - u : yabai -m space --focus next || yabai -m space --focus first
alt - q : yabai -m space --focus 1
alt - w : yabai -m space --focus 2
alt - f : yabai -m space --focus 3
alt - r : yabai -m space --focus 4
alt - b : yabai -m space --focus 5
alt - y : yabai -m space --focus 6
alt - u : yabai -m space --focus 7
alt - i : yabai -m space --focus 8
alt - o : yabai -m space --focus 9
# Moving windows to different spaces
alt + cmd - h : yabai -m window --space prev || yabai -m window --space last
alt + cmd - u : yabai -m window --space next || yabai -m window --spacefirst
alt + cmd - q : yabai -m window --space 1
alt + cmd - w : yabai -m window --space 2
alt + cmd - f : yabai -m window --space 3
alt + cmd - r : yabai -m window --space 4
alt + cmd - b : yabai -m window --space 5
alt + cmd - y : yabai -m window --space 6
alt + cmd - u : yabai -m window --space 7
alt + cmd - i : yabai -m window --space 8
alt + cmd - o : yabai -m window --space 9
# Space creation/destruction
alt + cmd - t : yabai -m space --create
alt + cmd - x : yabai -m space --destroy
# Window swap
alt + cmd - m : yabai -m window --swap west
alt + cmd - n : yabai -m window --swap south
alt + cmd - e : yabai -m window --swap north
alt + cmd - l : yabai -m window --swap east
# Change layout
alt - space : yabai -m space --rotate 270
# Maximize window
alt - return : yabai -m window --toggle zoom-fullscreen
# Reset layout
alt - escape : yabai -m space --balance
# Resize window
alt - m : yabai -m window --resize left:-100:0
alt - l : yabai -m window --resize right:100:0

40
yabai/yabairc Normal file
View file

@ -0,0 +1,40 @@
# This ensures that yabai runs sudo yabai -m --load-sa when the dock restarts
# It's been configured to run without prompting user for password in:
# /private/etc/sudoers.d/yabai
# This requiers SIP to be partially disabled.
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa
# Messages are used to communicate to a running Yabai instance, or -m for short.
#
# Example of how to override layouts for different spaces
# yabai -m config --space 2 layout float
# This also works for other commands as well, for instance:
# yabai -m config --space 2 window_gap 0
#
# Default layout: bsp = handled, float = non-handled
yabai -m config layout bsp
# Only show window shadow for floating windows
yabai -m config window_shadow float
# Window spacing
yabai -m config top_padding 8
yabai -m config bottom_padding 8
yabai -m config left_padding 8
yabai -m config right_padding 8
yabai -m config window_gap 8
# Window opacity
yabai -m config window_opacity on
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.95
# Overridden settings for specific windows.
yabai -m rule --add app="System Settings" manage=off
# Make sure sudo is able to run the command without prompting for a password.
# Border colors have been removed from Yabai as they were a drastic perf hit.
# Using Yabai in conjunction with JankyBorders which doesnt use Accessability API
borders style=round active_color=0xffdda887 inactive_color=0xff3c3d5b width=4.0 blacklist="System Settings" &

6
yabai_launcher Normal file
View file

@ -0,0 +1,6 @@
# replace <user> with your username (output of: whoami).
# replace <hash> with the sha256 hash of the yabai binary (output of: shasum -a 256 $(which yabai)).
# this hash must be updated manually after running brew upgrade.
# replace <yabai> with the path to the yabai binary (output of: which yabai).
larssonmartin1998 ALL=(root) NOPASSWD: sha256:5c729cfc728ec8780c14d6fe0bfd74376bd2f057960b542c41106d8e8c5df787 /opt/homebrew/bin/yabai --load-sa