Right now...
yabai -m display/space --move next
yabai -m display/space --focus next
yabai -m window --display/space next
All are unidirectional commands, and don't appear to 'loop back'. That is, if I have two displays or spaces, and tap the key twice (next and next), one might expect to end up where you started. I understand that if you're working in large linear space arrangements, it might be best to not accidentally wrap around, but I'd like the option to do so.
Is there a way to get a target like yabai -m display/space --move cycle which goes through the available spaces, and loops back? Or some other way to accomplish this looping?
Thanks!
For what it's worth, 'recent' almost accomplishes this in a two-space paradigm, BUT it only works if you've already focused another space since Yabai was started.
You should be able to do this by relying on the exit code of the command. Something like the following for spaces:
yabai -m space --focus next || yabai -m space --focus first
and
yabai -m space --focus prev || yabai -m space --focus last
Same principle should apply for the other commands you mentioned as well.
Nice, this should be documented in the Wiki
Added some note to the wiki in the commands section.
Most helpful comment
You should be able to do this by relying on the exit code of the command. Something like the following for spaces:
yabai -m space --focus next || yabai -m space --focus firstand
yabai -m space --focus prev || yabai -m space --focus lastSame principle should apply for the other commands you mentioned as well.