wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

More window rules may be needed

Open tsujan opened this issue 2 years ago • 8 comments

I think there's already a feature request about stickiness (couldn't find it), but:

If Wayfire had rules under [window-rules] for making windows go to bottom(/top) and/or be sticky, it would be possible to use pcmanfm-qt's desktop module — and perhaps other things — with it consistently.

More rules might also be useful/needed if possible.

EDIT: Maybe https://github.com/WayfireWM/wayfire/issues/1566 is a special case of this feature request.

tsujan avatar Sep 06 '22 17:09 tsujan

Related to #1410

stefonarch avatar Sep 10 '22 11:09 stefonarch

Yet another rule, that's especially important for notifications, is preventing the window from grabbing the focus (= being activated) on creation.

I don't know if Wayfire has a way of not activating a window on creation, but I didn't find any.

tsujan avatar Sep 10 '22 16:09 tsujan

I don't know if Wayfire has a way of not activating a window on creation, but I didn't find any.

Wayfire tries to guess whether the window needs focus or not. What kind of a notification daemon do you use? Wayland-native ones like mako should work out of the box.

ammen99 avatar Sep 10 '22 18:09 ammen99

That was just a suggestion. lxqt-notificationd works fine under Wayfire. My goal was making Qt apps that don't depend on X11 comfortably usable under Wayfire.

tsujan avatar Sep 10 '22 19:09 tsujan

This is a patch that adds sticky, always_on_top and the 2nd idea from #1566.

soreau avatar Sep 12 '22 04:09 soreau

@soreau, thanks! I applied it to 0.7.4, and now I can auto-start Conky on all desktops by using this rule:

on created if app_id is "Conky" then sticky

tsujan avatar Sep 12 '22 15:09 tsujan

@tsujan Check out #1572, I changed it so it's 'set always_on_top' and 'set sticky', since it seemed to make more sense.

soreau avatar Sep 19 '22 19:09 soreau

since it seemed to make more sense

Yes, it's more consistent with other parts, like "on created",...

tsujan avatar Sep 19 '22 19:09 tsujan

#1572 has been merged.

soreau avatar Nov 14 '22 14:11 soreau

@tsujan I tried this rule but conky only appeared on the first Desktop, How conky can appear to all workspace? Do you need to apply other settings? [window-rules] rule_21 = on created if app_id is "Conky" then sticky

bluebyt avatar Feb 11 '23 11:02 bluebyt

@bluebyt65 I think the rule should be

rule_21 = on created if (app_id equals "Conky") then set sticky

marcusbritanicus avatar Feb 11 '23 12:02 marcusbritanicus

@marcusbritanicus I tried this, but I have the same result, I restart conky and it appeared only on one Desktop, nevertheless thanks for helping me! rule_21 = on created if (app_id equals "Conky") then set sticky

bluebyt avatar Feb 11 '23 13:02 bluebyt

on created if app_id is "Conky" then set sticky

tsujan avatar Feb 11 '23 13:02 tsujan

@tsujan No same result, it only appeared on the Desktop that I started conky.

bluebyt avatar Feb 11 '23 13:02 bluebyt

@bluebyt65, are you sure you have the commit https://github.com/WayfireWM/wayfire/pull/1572?

tsujan avatar Feb 11 '23 13:02 tsujan

I thought that this commit was merge to the master branch? wayfire -v 0.8.0-c3dac7ee (Oct 1 2022, branch 'HEAD')

My bad I thing I forgot to restart wayfire after updating to the master branch, I will try it later. Thanks for your helps!

bluebyt avatar Feb 11 '23 13:02 bluebyt

Finally a have the latest master branch, but it still doesn't work. wayfire -v 0.8.0-c3dac7ee (Oct 1 2022, branch 'HEAD')

bluebyt avatar Feb 12 '23 12:02 bluebyt

@bluebyt65 You want 'set sticky' in the rule not just 'sticky'.

soreau avatar Feb 12 '23 14:02 soreau

@soreau What are the difference between 'set sticky' and 'sticky'? This is my rule: rule_21 = on created if app_id is "Conky" then set sticky

But Conky only appeared on the Desktop I have started Conky. I want it to appear on all workspace.

bluebyt avatar Feb 12 '23 14:02 bluebyt

The app_id is "conky" with lowercase 'c'. You can find this information easily with wf-info.

soreau avatar Feb 12 '23 15:02 soreau

Your conky id may not be "Conky". Find it with wf-info.

EDIT: Conky's id may be set in its config file.

tsujan avatar Feb 12 '23 15:02 tsujan

I tried both 'Conky' and 'conky' but I got the same result.

@soreau I didn't know about wf-info, I usually get the ap_id in the file wayfire.log Example: app_id equals variant: [type: string, value: Conky]

I will post my config later, maybe it contain something wrong @tsujan 'EDIT: Conky's id may be set in its config file.' I didn't know that you can set Conky id, I will look at that.

bluebyt avatar Feb 12 '23 15:02 bluebyt

Here the log file.

wayfire.log

wayfire.ini

Conky

bluebyt avatar Feb 12 '23 21:02 bluebyt

For other reason I had to reinstall Wayfire and now somehow the rule sticky are working with conky. rule_21 = on created if app_id is "Conky" then set sticky

One think thought, conky shouldn't appear in Scale or switcher screen. screenshot-2023-02-13-05:43:15 resized

bluebyt avatar Feb 15 '23 22:02 bluebyt

Would it be possible to define the layer to be able to set a dock accordingly? or a wallpaper app?

JoaquinDecima avatar Feb 16 '23 14:02 JoaquinDecima

@JoaquinDecima Currently, there are no rules to define the layer. However, rather than using window rules, it's best to write a simple plugin to do the job. You should look at the background-view plugin from wayfire-plugins-extra.

https://github.com/WayfireWM/wayfire-plugins-extra/blob/master/src/background-view.cpp#L118

marcusbritanicus avatar Feb 16 '23 18:02 marcusbritanicus

For other reason I had to reinstall Wayfire and now somehow the rule sticky are working with conky. rule_21 = on created if app_id is "Conky" then set sticky

One think thought, conky shouldn't appear in Scale or switcher screen.

If you set own_window_type=desktop in ~/.conkyrc, this patch should automatically place conky on the background layer and make it sticky, while not appearing in switchers or scale.

soreau avatar Feb 24 '23 10:02 soreau

I also see it logical that all views should appear when switch and scale plugins are used (sticky views included), except for those views that aren't supposed to be focused or raised (at some point and by using future rules).

tsujan avatar Feb 24 '23 10:02 tsujan

For other reason I had to reinstall Wayfire and now somehow the rule sticky are working with conky. rule_21 = on created if app_id is "Conky" then set sticky One think thought, conky shouldn't appear in Scale or switcher screen.

If you set own_window_type=desktop in ~/.conkyrc, this patch should automatically place conky on the background layer and make it sticky, while not appearing in switchers or scale.

@soreau I hope this patch will be merge to master branch, I have to learn how to apply a patch :)

bluebyt avatar Feb 25 '23 09:02 bluebyt

@bluebyt65 The other way to do this is to set conky for command and app_id options in background-view plugin, though it might always end up at top/left.

soreau avatar Feb 25 '23 15:02 soreau