-
-
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
Swap the current node and the biggest node #186
Comments
This has been possible since the addition of #105, which added the window selectors # syntax: yabai -m window [<sel>] --swap largest
# e.g. to swap the focused window with the largest window:
yabai -m window --swap largest |
Thanks again. I did not see it in the documentation: Apparently, one can find it under |
@dominiklohmann |
It returns a non-zero exit code, so you can use yabai -m window --swap largest || yabai -m window --swap last Additionally, if you want the first output to not appear in your error log file for skhd when it fails, you can redirect it's error message to yabai -m window --swap largest 2> /dev/null || yabai -m window --swap last However... this really makes no sense to do at all here. If focusing the |
I was not clear enough: I meant the last window swapped with. Maybe a way could be to store on the first invocation of Is there a possibility to store a value persistently between invocations of mappings in an skhdrc config? |
The closest built-in thing is the
Store the value in a file in # I have not tested this, but I think this should work
(yabai -m window --swap largest && yabai -m query --windows --window | jq -r '.id' > "${TMPDIR}/yabai_last_window_swapped_wid") || yabai -m window --swap "$(cat "${TMPDIR}/yabai_last_window_swapped_wid")" |
Yes, this helps me. However, the exit code of Is this intentional? |
Well it's not like the swap failed, it's just a no-op. Not sure if this can be considered a bug for swap/warp. I created a new issue to discuss this behaviour (#187). |
Instead of relying on the exit code, another possibility is to check if the window id of largest window is unchanged:
I use zsh which complains by |
You can setopt CLOBBER in zsh to use the POSIX sh compatible behaviour. You probably have it unset somewhere, I think it‘a a default option. |
It has turned out that the 'directory' module of zimfw which I use does this: |
bspwm offers to swap the current node and the biggest node and has an example shortcut for this in the example config file:
I would find this useful as well since I tend to treat one area as my main working area (similar to what under Amethyst is called main pane or under Xmonad master area).
The text was updated successfully, but these errors were encountered: