Skip to content

Commit

Permalink
skhd: add shortcut for stacking
Browse files Browse the repository at this point in the history
  • Loading branch information
rriski committed Jul 20, 2023
1 parent 29d9b03 commit 6b292f2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions skhd/skhdrc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ shift + alt - left : yabai -m window --grid 1:2:0:0:1:1
shift + alt - right : yabai -m window --grid 1:2:1:0:1:1


##############################################
# Stacking
##############################################

alt - k : 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 - j : 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 {}


##############################################
# Tmux
##############################################
Expand Down

0 comments on commit 6b292f2

Please sign in to comment.