koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
24.05k stars 649 forks source link

Weird config issue/behaviour. #1836

Closed thefiredman closed 1 year ago

thefiredman commented 1 year ago
yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa

yabai -m config layout                          bsp 
yabai -m config mouse_follows_focus             off
yabai -m config focus_follows_mouse             off
yabai -m config window_topmost                  off
yabai -m config window_border                   off
yabai -m config window_opacity                  off
yabai -m config split_ratio                     0.5
yabai -m config auto_balance                              on
yabai -m config window_gap                                0
yabai -m config mouse_modifier                    alt

# lock windows
yabai -m space 1 --label "Browser"
yabai -m space 2 --label "Term"
yabai -m space 8 --label "Music"
yabai -m rule --add app="Spotify" space="Music"

# float system preferences
yabai -m rule --add app="^" manage=off
yabai -m rule --add app=Alacritty manage=on
yabai -m rule --add app=Safari manage=on
yabai -m rule --add app=Firefox manage=on

I attempted to set the default window as floating while only specifying tiling behavior for certain apps. However, this configuration led to numerous bugs when attempting to go full-screen or even encountering certain hover events while using Safari.

I am not knowledgeable enough to know of a better way to achieve this and was hoping to get some support by reporting this as a problem.

koekeishiya commented 1 year ago

You should not use manage=on like this. It is meant for applications that mismanage their accessiblity role on macOS, so that windows can be forced to tile.

What you want is to use the window_created signal to unfloat specific windows upon creation:

window_created
    Triggered when a window is created.
    Also applies to windows that are implicitly created at application launch.
    Eligible for app and title filter.
    Passes one argument: $YABAI_WINDOW_ID

Signal docs: https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#signal

Something like:

yabai -m signal --add event="window_created" app="^(Alacritty|Safari|Firefox)$" action="yabai -m window \$YABAI_WINDOW_ID --toggle float"

thefiredman commented 1 year ago

I will close this issue as its not that important.