Skip to content

Commit

Permalink
skhd keybinds for yabai stacked window focussing:
Browse files Browse the repository at this point in the history
  • Loading branch information
tjex committed Mar 17, 2024
1 parent 97172a1 commit e5bcc56
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .config/skhd/skhdrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# Apple's stock Applications must be opened with `open -a`
alt + cmd - w : "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
alt + cmd - return : Applications/WezTerm.app/Contents/MacOS/wezterm
alt + cmd - b : /Applications/WezTerm.app/Contents/MacOS/wezterm start zsh -l -c "bkmr search --fzf"
alt + cmd - e : /Applications/WezTerm.app/Contents/MacOS/wezterm start lf ~
alt + cmd - g : /Applications/WezTerm.app/Contents/MacOS/wezterm start zsh -l -c gopass
alt + cmd - x : /Applications/WezTerm.app/Contents/MacOS/wezterm start qalc
alt + cmd - b : Applications/WezTerm.app/Contents/MacOS/wezterm start zsh -l -c "bkmr search --fzf"
alt + cmd - e : Applications/WezTerm.app/Contents/MacOS/wezterm start lf ~
alt + cmd - g : Applications/WezTerm.app/Contents/MacOS/wezterm start zsh -l -c gopass
alt + cmd - x : Applications/WezTerm.app/Contents/MacOS/wezterm start qalc

alt + cmd - 0x27 : open -a Dictionary # key = '

# yabai #
Expand All @@ -38,6 +39,19 @@ alt + cmd - j : yabai -m window --focus south
alt + cmd - k : yabai -m window --focus north
alt + cmd - l : yabai -m window --focus east

# cycle between stacked windows
alt + cmd - n : yabai -m query --spaces --space \
| jq -re ".index" \
| xargs -I{} yabai -m query --windows --space {} \
| jq -sre 'add | map(select(."is-minimized"==false)) | sort_by(.display, .frame.y, .frame.x, .id) | . as $array | length as $array_length | index(map(select(."has-focus"==true))) as $has_index | if $has_index > 0 then nth($has_index - 1).id else nth($array_length - 1).id end' \
| xargs -I{} yabai -m window --focus {}

alt + cmd - p : yabai -m query --spaces --space \
| jq -re ".index" \
| xargs -I{} yabai -m query --windows --space {} \
| jq -sre 'add | map(select(."is-minimized"==false)) | sort_by(.display, .frame.y, .frame.x, .id) | . as $array | length as $array_length | index(map(select(."has-focus"==true))) as $has_index | if $array_length - 1 > $has_index then nth($has_index + 1).id else nth(0).id end' \
| xargs -I{} yabai -m window --focus {}

shift + alt + cmd - h : yabai -m window --swap west
shift + alt + cmd - j : yabai -m window --swap south
shift + alt + cmd - k : yabai -m window --swap north
Expand Down

0 comments on commit e5bcc56

Please sign in to comment.