-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add <SPACE_SEL> to yabai -m space --move
#127
Comments
I think this is a good idea, and swap should be a separate thing as well. Note though that these are different operations:
Also it only needs to accept one space selector, as you can always set the optional space selector before the command. As a workaround for move, you can use this script. Edit Updated the script at 21:30 CEST to be more robust. #! /usr/bin/env zsh
# invoke like this: path/to/script [from-selector] to-selector
# examples:
# - move current space to end: path/to/script last
# - move 2nd space to previous: path/to/script 2 prev
index_from_sel() {
yabai -m query --spaces --space $@ \
| jq -re '.index'
}
if [ $# -eq 1 ]; then
from_sel="$(index_from_sel)"
to_sel="$(index_from_sel $1)"
elif [ $# -eq 2 ]; then
from_sel="$(index_from_sel $1)"
to_sel="$(index_from_sel $2)"
else
exit 1
fi
if [ $to_sel -lt $from_sel ]; then
direction="prev"
elif [ $to_sel -gt $from_sel ]; then
direction="next"
else
exit 1
fi
seq $from_sel $to_sel \
| sed '$d' \
| xargs -I{} yabai -m space {} --move $direction |
Implemented partial support for this - not sure if I want to deal with the complexity of allowing move across display boundaries..
|
…n of the selected and given space
There is also a new command
|
I experimented a bit with allowing swap across displays because it seemed like a useful feature, but there is just a whole bunch of complexity that it was hard to get it working correctly in every possible scenario. Leaving it with the constraint of spaces having to belong to the same display for now. Part of v2.3.0 |
Feature request
I'd like to be able to swap the focused space with any other space (not only previous and next space).
Maybe another, more portable solution would be to have a
--swap <SPACE_SEL> <SPACE_SEL>
option that swaps any two spaces.Let me know what you think :)
The text was updated successfully, but these errors were encountered: