Is there a yabai command that can be used to hide or minimize a window and then bring it back as needed? I'd love to be able to have a floating terminal or browser window that I can use quickly and then disappear analogous to cmd-H, but with the ability to also bring it back w/the keyboard without having to cmd-tab to find it?
Thanks!
Some notes on the application switcher:
Regarding your problem: using yabai, you could always float the window and move it to the bottom right corner to effectively hide it:
# grab the target window id (in this case of the focused window)
target_window="$(yabai -m query --windows --window | jq -re '.id')"
# float the target window and move it to somewhere that's far off to the bottom right
# (regardless of which window is focused at this point)
yabai -m window "${target_window}" --toggle float --move abs:10000:10000
# unfloat the target window to tile it again
yabai -m window "${target_window}" --toggle float
You can easily create a script for this to create some kind of collection of hidden windows per space.
Edit:
In general in macOS, hiding is done per-application and minimising is done per-window. If you want to hide an application and have a script unhide it, use the following:
target_app="iTerm2"
# hide app
osascript -e "tell application \"System Events\" to set visible of first process 卢" \
-e "whose name is \"${target_app}\" to false"
# unhide app
osascript -e "tell application \"System Events\" to set visible of first process 卢" \
-e "whose name is \"${target_app}\" to true"
There is an easier way to do that. Just drag and drop the window you want to minimize to another space. That's it!
Most helpful comment
Some notes on the application switcher:
Regarding your problem: using yabai, you could always float the window and move it to the bottom right corner to effectively hide it:
You can easily create a script for this to create some kind of collection of hidden windows per space.
Edit:
In general in macOS, hiding is done per-application and minimising is done per-window. If you want to hide an application and have a script unhide it, use the following: