koekeishiya / yabai

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

Rules are not working since v7.1.0 #2254

Open patlux opened 6 months ago

patlux commented 6 months ago

Hi,

I had to downgrade to v7.0.4 because in v7.1.0 my rules are not working anymore:

#!/usr/bin/env sh

# Global settings

yabai -m config \
  mouse_follows_focus          off            \
  focus_follows_mouse          off            \
  window_placement             second_child   \
  window_shadow                on             \
  window_opacity               off            \
  window_opacity_duration      0.0            \
  active_window_opacity        1.0            \
  normal_window_opacity        0.90           \
  insert_feedback_color        0xffd75f5f     \
  split_ratio                  0.50           \
  auto_balance                 off            \
  mouse_modifier               fn             \
  mouse_action1                move           \
  mouse_action2                resize         \
  mouse_drop_action            swap           \
  layout                       bsp            \
  top_padding                  12             \
  bottom_padding               12             \
  left_padding                 12             \
  right_padding                12             \
  window_gap                   06

# Rules

# yabai -m query --windows --space

yabai -m rule --add label="About This Mac" app="System Information" title="About This Mac" manage=off
yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add label="Software Update" title="Software Update" manage=off
yabai -m rule --add label="Finder" app="^Finder$" title="(Co(py|nnect)|Move|Info|Pref)" manage=off
yabai -m rule --add label="Safari" app="^Safari$" title="^(General|(Tab|Password|Website|Extension)s|AutoFill|Se(arch|curity)|Privacy|Advance)$" manage=off
yabai -m rule --add label="The Unarchiver" app="^The Unarchiver$" manage=off
yabai -m rule --add label="ScreenTray" app="^ScreenTray$" manage=off
yabai -m rule --add app="^Simulator$" manage=off sticky=on
yabai -m rule --add title="^iPhone.*" manage=off sticky=on
yabai -m rule --add app="^CleanShot X$" sticky=on manage=off
yabai -m rule --add app="Petit Player" sticky=on manage=off
yabai -m rule --add app="Bezel" sticky=on manage=off

echo "yabai configuration loaded.."

MacBook Pro Max M2. I'm using only the tiling feature. System Integrity Protection is enabled on my system.

vsuharnikov commented 6 months ago

Found this https://github.com/koekeishiya/yabai/issues/2230#issuecomment-2051763422 :

yabai -m rule --apply

And it helped me

PrayagS commented 6 months ago

There was a change in version 7.0.0 that changed how rules work. Now they only apply to windows opened after the rule is added.

Adding what @vsuharnikov has shared after declaring all the rules restores the older behavior.

dantaeusb commented 6 months ago

@PrayagS it doesn't really – if you restart yabai at any moment, it won't work anymore for existing windows (which I'm quite sure worked before). It seems like the proper equivalent would be BOTH --add and --apply. Is there a documentation for that? The https://github.com/koekeishiya/yabai/wiki/Commands#window-commands wiki section doesn't cover the change at all.

PrayagS commented 6 months ago

It seems like the proper equivalent would be BOTH --add and --apply.

Yeah that's what I meant. I declare all the rules using --add and then do --apply at the end as shown above.

Is there a documentation for that?

dantaeusb commented 6 months ago

Yeah that's what I meant.

Understood, thanks! I was thinking maybe there's an alternative flag which does both at the same time, but consulting https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#rule, looks like for now I'll have to use two commands per window too in .yabairc.