wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Multiple window rules: with "then move" "then assign_workspace" not executed

Open stefonarch opened this issue 2 years ago • 16 comments

Describe the bug With those window rules

rule_3 = on created if app_id is "qterminal" then assign_workspace 1 0
rule_4 = on created if app_id is "qterminal" then resize 1924 1022
rule_5 = on created if app_id is "qterminal" then move 0 10

Application will open always on current workspace. Tested also for org.kde.kcolorchooser.

To Reproduce

  1. Assign "move" and "assign_workspace" (and eventually more rules) to an application
  2. Open it
  3. It will not respect "assign_workspace"
  4. comment "move" rule
  5. open application, it will respect workspace again.

Expected behavior

All rules are respected.

Screenshots or stacktrace

Wayfire version 0.8.0, git, branch alpha-add-ipc

stefonarch avatar Jan 22 '23 09:01 stefonarch

I have this issue also with move and geometry, workspace doesn't work, but if I comment out geometry, workspace will work. rule_1 = on created if app_id is "Alacritty" then assign_workspace 0 1 rule_2 = on created if app_id contains "Alacritty" then set geometry 500 180 700 550

wayfire -v
0.8.0-c3dac7ee (Oct 1 2022, branch 'HEAD')

bluebyt avatar Feb 12 '23 12:02 bluebyt

Here this happens also with snap but not with resize

rule_10 = on created if app_id is "org.telegram.desktop" then assign_workspace 2 0
rule_11 = on created if app_id is "org.telegram.desktop" then snap right

and telegram is always on 0 0 at startup

stefonarch avatar Feb 12 '23 18:02 stefonarch

Forgot about that, but it's still like that above, but only with telegram and not with element. Dots?

stefonarch avatar Feb 23 '23 20:02 stefonarch

Still the same atm, with those rules "telegram_2" is not executed at startup:

[window-rules]
element_1 = on created if app_id is "Element" then snap left
element_2 = on created if app_id is "Element" then assign_workspace 2 0
telegram_1 = on created if title contains "Telegram" then assign_workspace 2 0
telegram_2 = on created if title contains "Telegram" then snap right

stefonarch avatar Oct 05 '23 07:10 stefonarch

Looking at this again,

rule_3 = on created if app_id is "qterminal" then assign_workspace 1 0 rule_4 = on created if app_id is "qterminal" then resize 1924 1022 rule_5 = on created if app_id is "qterminal" then move 0 10

'of course' qterminal will be moved back to the current workspace: coordinates are relative to the current workspace. By saying move 0 10 you tell it to move to the current workspace. I would first move/resize the view (which can btw be done with a single set_geometry command) and then assign the workspace. Have you tried that?

ammen99 avatar Oct 14 '23 11:10 ammen99

Actually I'm using another method for qterminal, let the app starting with size I want, so the only issue left is with telegram, but probably the issue with qterminal was that.

If I remember well only one rule works, with both none works, but should test this if true really.

stefonarch avatar Oct 14 '23 13:10 stefonarch

Change the order solve the problem for me, workspace should be at the end. rule_1 = on created if app_id contains "Alacritty" then set geometry 500 180 700 550 rule_2 = on created if app_id is "Alacritty" then assign_workspace 0 1

bluebyt avatar Oct 15 '23 09:10 bluebyt

Change the order solve the problem for me, workspace should be at the end.

Tried with that - same result, snap right isn't executed:

telegram_1 = on created if title contains "telegram" then snap right
telegram_2 = on created if title contains "telegram" then assign_workspace 2 0

Even worse: with

telegram_1 = on created if title is "org.telegram.desktop" then snap right
telegram_2 = on created if title is "org.telegram.desktop" then assign_workspace 2 0

none is executed.

stefonarch avatar Oct 15 '23 10:10 stefonarch

Giving up, as sometimes it isn't even reproducible, atm none of both rules are executed. And also only telegram_2 = on created if app_id contains "Telegram" then assign_workspace 2 0 doesnt work.

lswt 2: ---- "Telegram (47)" org.telegram.desktop

stefonarch avatar Oct 15 '23 10:10 stefonarch

You are comparing title with app_id, you are not considering case sensitive also, "Word" does not exist in "word"

not sure what are you trying to do but that works rule_5 = on created if app_id is "qterminal" then assign_workspace 0 2 rule_4 = on created if app_id is "qterminal" then resize 400 400 rule_3 = on created if app_id is "qterminal" then move 1 0

also some apps like nautilus, has a initial title like "Loading..." then the final title.

consider case sensitive and use app_id instead

killown avatar Mar 11 '24 12:03 killown

Oh that's a good point, @stefonarch you're looking for part of the title in the app-id. That must be why it works for others but not for you.

ammen99 avatar Mar 11 '24 12:03 ammen99

True. But did just a test with telegram_2 = on created if app_id contains "telegram" then assign_workspace 2 0 and it's not working too. "Telegram" was probably a leftover from trying with title.

stefonarch avatar Mar 11 '24 15:03 stefonarch

True. But did just a test with telegram_2 = on created if app_id contains "telegram" then assign_workspace 2 0 and it's not working too. "Telegram" was probably a leftover from trying with title.

Did you also reorder the other two window rules to happen alphabetically before the assign workspace one?

ammen99 avatar Mar 11 '24 15:03 ammen99

True. But did just a test with telegram_2 = on created if app_id contains "telegram" then assign_workspace 2 0 and it's not working too. "Telegram" was probably a leftover from trying with title.

no, this won't work, must be app_id is "org.telegram.desktop"

killown avatar Mar 11 '24 15:03 killown

True. But did just a test with telegram_2 = on created if app_id contains "telegram" then assign_workspace 2 0 and it's not working too. "Telegram" was probably a leftover from trying with title.

no, this won't work, must be app_id is "org.telegram.desktop"

contains should work as well?

ammen99 avatar Mar 11 '24 15:03 ammen99

True. But did just a test with telegram_2 = on created if app_id contains "telegram" then assign_workspace 2 0 and it's not working too. "Telegram" was probably a leftover from trying with title.

no, this won't work, must be app_id is "org.telegram.desktop"

contains should work as well?

not working in this case

killown avatar Mar 11 '24 15:03 killown