Closed aspauldingcode closed 3 weeks ago
All options need jq
to be installed in the system
Option I
This command will make a floating window go full-screen or toggle full-screen for bsp mode
yabai -m window --grid 1:1:0:0:1:1 || yabai -m window --toggle zoom-fullscreen
Additionally, add this to .yabairc to automatically restore back from full-screen on focus change in bsp mode.
yabai -m signal --add event=window_focused action='if [[ $(yabai -m query --windows --window | jq ".\"is-floating\"") == "false" ]]; then
win_id=$(yabai -m query --windows --space | jq "map(select(.\"has-fullscreen-zoom\" and (.\"has-focus\" | not)))[0].id")
if [[ $win_id != "null" ]]; then yabai -m window $win_id --toggle zoom-fullscreen; fi
fi'
Option II You can create an executable file to toggle monocle mode (make all apps full-screen and stack them) for a specific space:
yabai-monocle
file in your PATH/opt/homebrew/bin/yabai -m space --layout $( [ "$(/opt/homebrew/bin/yabai -m query --spaces --space | /opt/homebrew/bin/jq -re .type)" = 'bsp' ] && echo 'stack' || echo 'bsp' )
chmod +x yabai-monocle
yabai -m window --grid 1:1:0:0:1:1 || yabai-monocle
Option III
Send a window to a new space. Then it will be in full-screen anyway, as the only window in it.
yabai -m space --create; yabai -m window --space next; yabai -m space --focus next
Additionally, you can add auto-deletion of empty spaces in .yabairc
yabai -m signal --add event=space_changed action='RSINDEX=$(yabai -m query --spaces | jq ".[] | select (.id == $YABAI_RECENT_SPACE_ID) | .index") && if [ "$(yabai -m query --spaces --space $RSINDEX | jq -re '.windows')" = "[]" ] ; then yabai -m space $RSINDEX --destroy ; fi'
Additionally
Cycle through windows/spaces/displays with 2 directional keys
Previous yabai -m window --focus prev || yabai -m space --focus prev || yabai -m space --focus last
Next yabai -m window --focus next || yabai -m space --focus next || yabai -m space --focus first
yabai -m window --grid 1:1:0:0:1:1 || yabai -m window --toggle zoom-fullscreen is already in my setup with alt + f.
However, this obeys my bar and window spacing. What I want is a way to simply toggle a complete fullscreen without the native macOS implementation. This will require changes to yabai itself I am sure, otherwise I can create an advanced bash toggle script to disable all my gaps config and bar spacing temperarily to fullscreen the window, but I don't want that to be for the whole space. I wish I could do this for a single window.
In other words, an instant fullscreen toggle with a command like (yabai -m window --toggle windowed-fullscreen)
Why not use native fullscreen for that?
the issue is still here.
I've created a manual fix but it's slow!
I think if yabai could just toggle fullscreen as an alternative to zoom fullscreen we would have this:
Why not use native fullscreen for that?
There should be an option that does NOT use macOS's animations. Native Fullscreen fades out, and moves the window to a completely different space.
I've created a manual fix but it's slow!
This is my second attempt with this.
My first used pheonixwm, before yabai v 7.0.0 and it was like so:
to go back though, it was messed up. I wanted a solution that doesn't use other window managers. All yabai would have to do is:
I have a working 3rd attempt. Leaving open for those who want this. It is a very nice feature that should already be there.
This is the functionality I was expecting:
https://github.com/koekeishiya/yabai/assets/10196826/e237b3ea-b6ed-469b-9f72-824b02b9f013
I have a working 3rd attempt.
@aspauldingcode Where did you publish the attempt? Sorry, couldn't find a link
When a window enters native fullscreen, it changes presentation mode which causes various changes to the window. This behaviour is not something that can be activated by yabai. It is special to the "native fullscreen-space" version.
I have added a command that ignores all configured padding (both padding and external_bar padding). yabai is not able to move the window into the Notch region or "into" the macOS menubar, so that space will always be reserved. It makes no sense to let the window extend into the Dock area either.
If Dock is hidden/has autohide enabled, yabai will extend the window across the Dock region. If the MacOS menubar is hidden/autohide enabled, yabai will attempt to place the window at the topmost coordinate (gated by the notch on newer macbooks).
This works for both managed and unmanaged windows.
yabai -m window --toggle windowed-fullscreen
yabai -m window --toggle windowed-fullscreen
Wow! I compiled from source and it works.
Thank you for working on this. However, the problem now is I can drag the window around with the mouse modifier.
We still need to implement a way to lock/disable mouse-modifier based on if a window is toggled on for a windowed-fullscreen.
I've done that by using statefiles in my scripts, then setting the at modifier to something ese like fn if I move over the active window. I used sketchybar to check events to calculate this more efficiently.
It would be great (for scripting purposes like this) if you added a new mouse modifier "none" which effectively disables it manually too.
Because right now, dragging a window which is meant to be an instant fullscreen is no longer fullscreen when moved around.
Maybe there could also be a check which sets a window flag to the current window, making sure if a window is-windowed-fullscreen true that the window stays windowed fullscreen until toggled off by the command.
I got it to work too. But it looks just like the zoom-fullscreen feature. i.e. the title-bar is still visible and draggable.
When a window enters native fullscreen, it changes presentation mode which causes various changes to the window. This behaviour is not something that can be activated by yabai. It is special to the "native fullscreen-space" version.
Allow a bsp window (or a floating window) to be toggled as fullscreen.
This fullscreen just extends the window to the corners of the display, and toggles ignorance of gaps/bars spacing config to do so.
This way, we can get an alternative to native-fullscreen, which users don't have to script their own gaps/bar toggle respect/ignore keybind to get a bsp window to fullscreen instantly, and it also doesn't require us to write our own toggle for making the window float first and respect the current display dimensions..