Jumping directionally between floating windows #1381
-
If I have two floating windows close to each other, can I somehow easily jump from one to the other, preferably using "directional commands" rather than cycling through all floating windows, similarly to how I would Edit: typo |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
The directional commands only apply to managed windows. You'd have to script something yourself using the query system. I believe something like this has been done previously in one of the closed issues, but I don't remember what to search for to locate it. docs for query: https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#query |
Beta Was this translation helpful? Give feedback.
-
A variant of this might work #1326 |
Beta Was this translation helpful? Give feedback.
-
Here's take 1, that does not jump directionally, but rather cycles windows that are floating, if the script is run from a floating window. If it is run from a tiled window it will jump between tiled windows. is_float=$(yabai -m query --windows --window | jq '."is-floating"')
if [ "$is_float" = "true" ]; then
yabai -m window --focus $(yabai -m query --windows | \
jq -e --argjson pos 1 '(.[] | select(."has-focus")) as {$id, $app}
| map(select(."is-floating" == true))
| sort_by(.space, .frame.x, .frame.y)
| map(.id)
| .[(index($id)+($pos))%length]')
else
yabai -m window --focus east || yabai -m display --focus east
fi Edit: Change 1 to -1 to move in the other direction. I put this in a script and bind it like this alt - h : ~/bin/yabai-left.sh
alt - l : ~/bin/yabai-right.sh |
Beta Was this translation helpful? Give feedback.
The directional commands only apply to managed windows. You'd have to script something yourself using the query system. I believe something like this has been done previously in one of the closed issues, but I don't remember what to search for to locate it.
docs for query: https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#query