add yabai

This commit is contained in:
Adam Jeniski 2022-12-05 16:29:06 -05:00
parent 6bb5a87b20
commit 7f847e45fd
5 changed files with 213 additions and 6 deletions

View File

@ -713,7 +713,7 @@ font_size 16.0
#: horizontal sides. Three values set top, horizontal and bottom. Four #: horizontal sides. Three values set top, horizontal and bottom. Four
#: values set top, right, bottom and left. #: values set top, right, bottom and left.
# single_window_margin_width -1 single_window_margin_width 3
#: The window margin to use when only a single window is visible (in #: The window margin to use when only a single window is visible (in
#: pts). Negative values will cause the value of window_margin_width #: pts). Negative values will cause the value of window_margin_width

View File

@ -1,10 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
LIMELIGHT=~/repos/limelight/bin/limelight LIMELIGHT=~/.config/limelight/limelight/bin/limelight
$LIMELIGHT -m config width 5 $LIMELIGHT -m config width 3
#$LIMELIGHT -m config radius 0 $LIMELIGHT -m config radius 10
#$LIMELIGHT -m config placement interior $LIMELIGHT -m config placement exterior
$LIMELIGHT -m config active_color 0xff30638e $LIMELIGHT -m config active_color 0xff30638e
$LIMELIGHT -m config normal_color 0x66003d5b $LIMELIGHT -m config normal_color 0x66003d5b

88
.config/skhd/skhdrc Normal file
View File

@ -0,0 +1,88 @@
# Services
hyper - z : brew services restart yabai
hyper - x : brew services restart skhd
# Moving windows
hyper - w : yabai -m window --warp north || $(yabai -m window --display north; yabai -m display --focus north)
hyper - a : yabai -m window --warp west || $(yabai -m window --display west; yabai -m display --focus west)
hyper - s : yabai -m window --warp south || $(yabai -m window --display south; yabai -m display --focus south)
hyper - d : yabai -m window --warp east || $(yabai -m window --display east; yabai -m display --focus east)
# Toggle mouse focus mode
hyper - m : [[ $(yabai -m config focus_follows_mouse) = "disabled" ]] && \
yabai -m config focus_follows_mouse autoraise || \
yabai -m config focus_follows_mouse off
# Resize windowsa
hyper - i : \
yabai -m window --resize top:0:-20 ; \
yabai -m window --resize bottom:0:-20
hyper - j : \
yabai -m window --resize left:-20:0 ; \
yabai -m window --resize right:-20:0
hyper - k : \
yabai -m window --resize bottom:0:20 ; \
yabai -m window --resize top:0:20
hyper - l : \
yabai -m window --resize right:20:0 ; \
yabai -m window --resize left:20:0
# Rotate windows
hyper - r : yabai -m space --rotate 270
# Mirror tree y-axis
hyper - y : yabai -m space --mirror y-axis
# Balance size of windows
hyper - b : yabai -m space --balance
# float / unfloat window and center on screen
hyper - h : yabai -m window --toggle float;\
yabai -m window --grid 4:4:1:1:2:2
# toggle window zoom
hyper - t : yabai -m window --toggle zoom-parent
hyper - f : yabai -m window --toggle zoom-fullscreen
# Enable / Disable gaps in current workspace
hyper - 0 : yabai -m space --toggle padding; yabai -m space --toggle gap
# Cycle windows forwards
hyper - e : yabai -m window --focus prev || yabai -m window --focus last
# hyper - e : yabai -m query --spaces --space \
# | jq -re ".index" \
# | xargs -I{} yabai -m query --windows --space {} \
# | jq "map(select(.minimized == 0))" \
# | jq -sre "add | sort_by(.display, .frame.x, .frame.y, .id) | reverse | nth(index(map(select(.focused == 1))) - 1).id" \
# | xargs -I{} yabai -m window --focus {}
# Cycle windows backwards
hyper - q : yabai -m window --focus next || yabai -m window --focus first
# hyper - q : yabai -m query --spaces --space \
# | jq -re ".index" \
# | xargs -I{} yabai -m query --windows --space {} \
# | jq "map(select(.minimized == 0))" \
# | jq -sre "add | sort_by(.display, .frame.x, .frame.y, .id) | nth(index(map(select(.focused == 1))) - 1).id" \
# | xargs -I{} yabai -m window --focus {}
# Cycle windows forwards and backwards in focused stack only
hyper - tab : yabai -m window --focus stack.next || yabai -m window --focus stack.first
# Cycle windows forwards and backwards but stops at ends
# hyper - tab : yabai -m window --focus stack.prev || yabai -m window --focus prev || yabai -m window --focus last
# hyper - tab : yabai -m window --focus stack.next || yabai -m window --focus next || yabai -m window --focus first
hyper - up : yabai -m window --stack north
hyper - right : yabai -m window --stack east
hyper - down : yabai -m window --stack south
hyper - left : yabai -m window --stack west
# Make focused window stack starter
# hyper - tab : yabai -m query --spaces --space \
# | jq -re ".index" \
# | xargs -I{} yabai -m query --windows --space {} \
# | jq -sre "add | sort_by(.display, .frame.x, .frame.y, .id) | nth(index(map(select(.focused == 1)))).id" \
# | xargs -I{} yabai -m window {} --insert stack

119
.config/yabai/yabairc Executable file
View File

@ -0,0 +1,119 @@
#!/usr/bin/env sh
#YABAI STUFF
# bsp or float (default: bsp)
#yabai -m config layout bsp
# My custom space names for my 3 monitor setup. These names are used in some of my scripts.
yabai -m space 1 --label one
yabai -m space 2 --label two
yabai -m space 3 --label three
yabai -m space 4 --label four
yabai -m space 5 --label five
yabai -m space 6 --label six
yabai -m space 9 --label nine
# float system preferences. Most of these just diable Yabai form resizing them.
yabai -m rule --add app="^System Preferences$" sticky=on layer=above manage=off
yabai -m rule --add app="^Karabiner-Elements$" sticky=on layer=above manage=off
yabai -m rule --add app="^Karabiner-EventViewer$" sticky=on layer=above manage=off
yabai -m rule --add app="^Finder$" sticky=on layer=above manage=off
yabai -m rule --add app="^Keka$" sticky=on layer=above manage=off
yabai -m rule --add app="^Alfred Preferences$" sticky=on layer=above manage=off
yabai -m rule --add app="^Disk Utility$" sticky=on layer=above manage=off
yabai -m rule --add app="^System Information$" sticky=on layer=above manage=off
yabai -m rule --add app="^Activity Monitor$" sticky=on layer=above manage=off
yabai -m rule --add app="^Path Finder$" manage=off
yabai -m rule --add app="^TeamViewer$" sticky=off layer=above manage=off
yabai -m rule --add app="Fantastical" manage=off
yabai -m rule --add app="^Spotify$" manage=off
yabai -m rule --add app="^iTerm2$" manage=off
yabai -m rule --add app="^Flux$" manage=off
yabai -m rule --add app="^Time Out$" manage=off
yabai -m rule --add app="^perl_client_app$" manage=off
yabai -m rule --add app="^console$" manage=off
yabai -m rule --add app="^Harvest$" manage=off
yabai -m rule --add app="^CiscoSparkHelper$" manage=off
yabai -m rule --add app="^Logi Options$" manage=off
yabai -m rule --add app="^Cisco Webex Start$" manage=off
yabai -m rule --add app="^Private Internet Access$" manage=off
#find ~/Library/Parallels/Applications\ Menus/ -maxdepth 3 -type f | awk -F'/' '{ print $NF; }' | awk '{$1=$1};1' | sort | uniq | tr "\n" "\0" | xargs -0 -I{} yabai -m rule --add app="^{}\$" title=".*" manage=on
## Some random global settings
#yabai -m config focus_follows_mouse autoraise
#yabai -m config focus_follows_mouse on
# New window spawns to the right if vertical split, or bottom if horizontal split
yabai -m config window_placement second_child
yabai -m config window_topmost off
#yabai -m config window_shadow float
yabai -m config window_opacity off
yabai -m config window_opacity_duration 0.00
yabai -m config active_window_opacity 1.0
#yabai -m config normal_window_opacity 0.97
#yabai -m config window_border on | off
## WITH SIP ENABLED (Installed Limelight seperately, Don't need this)
yabai -m config window_border off
## WTIH SIP DISABLED (Limelight build into Yabai, enable it here)
#yabai -m config window_border on
#yabai -m config window_border_width 3
#yabai -m config active_window_border_color 0xFF40FF00
#yabai -m config normal_window_border_color 0x00FFFFFF
#yabai -m config insert_feedback_color 0xffd75f5f
## some other settings
yabai -m config auto_balance off
yabai -m config split_ratio 0.50
# # set mouse interaction modifier key (default: fn)
yabai -m config mouse_modifier ctrl
# set modifier + right-click drag to resize window (default: resize)
yabai -m config mouse_action2 resize
# set modifier + left-click drag to resize window (default: move)
yabai -m config mouse_action1 move
# general space settings
#yabai -m config focused_border_skip_floating 1
#yabai -m config --space 3 layout float
## Change how yabai looks
PADDING=5
yabai -m config layout bsp
yabai -m config top_padding $PADDING
yabai -m config bottom_padding $PADDING
yabai -m config left_padding $PADDING
yabai -m config right_padding $PADDING
yabai -m config window_gap 10
#Limelight addon (Kill it and start it each time Yabai starts)
killall limelight &> /dev/null
~/.config/limelight/limelight/bin/limelight -c ~/.config/limelight/limelightrc &> /dev/null &
# #Ubersicht widget bar stuff
#yabai -m signal --add event=space_changed \
#action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'"
#yabai -m signal --add event=display_changed \
#action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-primary-jsx\"'"
#yabai -m signal --add event=space_changed \
#action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-secondary-jsx\"'"
#yabai -m signal --add event=display_changed \
#action="osascript -e 'tell application \"Übersicht\" to refresh widget id \"nibar-spaces-secondary-jsx\"'"
# signals
# yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
#yabai -m signal --add event=space_changed action="yabai -m window --focus $(yabai -m query --windows --window | jq ".id")"
# yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse"
#testing signals
# yabai -m signal --add event=window_destroyed action="terminal-notifier -message 'window_destroyed'"
# yabai -m signal --add event=application_terminated action="terminal-notifier -message 'application_terminated'"
## If I close the active window, focus on any other visible window.
yabai -m signal --add event=window_destroyed action="bash /Users/jesseskelton/CustomScripts/SwitchSpaces/window-focus-on-destroy.sh"
# yabai -m signal --add event=space_changed action="export CUR_ACTIVE_APP=\"iTerm2\""
echo "yabai configuration loaded.."
#END

2
.zshrc
View File

@ -137,7 +137,7 @@ alias egrep='egrep --color=auto'
export PATH="/opt/homebrew/opt/cython/bin:$PATH" export PATH="/opt/homebrew/opt/cython/bin:$PATH"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH" export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
alias awb='~/repos/limelight/bin/limelight -c ~/.config/limelight/limelightrc' alias awb='~/.config/limelight/limelight/bin/limelight -c ~/.config/limelight/limelightrc'
export STARSHIP_CONFIG=~/.config/starship/starship.toml export STARSHIP_CONFIG=~/.config/starship/starship.toml
eval "$(starship init zsh)" eval "$(starship init zsh)"