WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.4k stars 178 forks source link

More window rules may be needed #1567

Closed tsujan closed 1 year ago

tsujan commented 2 years ago

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.

stefonarch commented 2 years ago

Related to #1410

tsujan commented 2 years ago

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.

ammen99 commented 2 years ago

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.

tsujan commented 2 years ago

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.

soreau commented 2 years ago

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

tsujan commented 2 years ago

@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
soreau commented 2 years ago

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

tsujan commented 2 years ago

since it seemed to make more sense

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

soreau commented 1 year ago

1572 has been merged.

bluebyt commented 1 year ago

@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

marcusbritanicus commented 1 year ago

@bluebyt65 I think the rule should be

rule_21 = on created if (app_id equals "Conky") then set sticky
bluebyt commented 1 year ago

@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

tsujan commented 1 year ago
on created if app_id is "Conky" then set sticky
bluebyt commented 1 year ago

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

tsujan commented 1 year ago

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

bluebyt commented 1 year ago

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 commented 1 year ago

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

soreau commented 1 year ago

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

bluebyt commented 1 year ago

@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.

soreau commented 1 year ago

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

tsujan commented 1 year ago

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

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

bluebyt commented 1 year ago

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 commented 1 year ago

Here the log file.

wayfire.log

wayfire.ini

Conky

bluebyt commented 1 year ago

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

JoaquinDecima commented 1 year ago

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

marcusbritanicus commented 1 year ago

@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

soreau commented 1 year ago

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.

tsujan commented 1 year ago

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).

bluebyt commented 1 year ago

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 :)

soreau commented 1 year ago

@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.

bluebyt commented 1 year ago

@soreau I added the following to wayfire.ini but that doesn't change anything. [core] background-view

[background-view] app-id = Conky command = Conky file =

stefonarch commented 1 year ago

Underscore now with latest git and maybe lowercase for conky:

[core]
....
 background-view \
....

[background-view]
app_id = conky
command = conky
bluebyt commented 1 year ago

wf-info for conky give me this "Conky" App ID: Conky

I changed for underscore but same result. [background-view] app_id = Conky command = Conky file =

stefonarch commented 1 year ago
$ Conky
bash: Conky: command not found
$ conky
conky: no personal or system-wide config file found, using builtin default
conky: desktop window (3c6) is root window
....
bluebyt commented 1 year ago

I tried both and my rule is working. rule_21 = on created if app_id is "Conky" then set sticky

stefonarch commented 1 year ago

I was saying that the command Conky doesn't exist.

[background-view]
command = conky
app_id = Conky

works here (with latest git for plugins-extra)

bluebyt commented 1 year ago

@stefonarch You are right, I changed the command as following, but conky it still appear in scale and switcher

[background-view] app_id = Conky command = conky -c $HOME/.conky/grumimosa/Mimosa.conf &> /dev/null & file =

ammen99 commented 1 year ago

Please discuss background-view issues in the issue tracker of wayfire-plugins-extra @bluebyt65 @stefonarch

JoaquinDecima commented 1 year ago

@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

There is the possibility that you give me a hand writing the plugin, or guiding me. I never programmed in C++ and with my little time it is difficult for me to understand the code that you provided me.

Sorry, my english is very bad From already thank you very much

@marcusbritanicus

soreau commented 1 year ago

If you join matrix or IRC, we might be able to help you further.

marcusbritanicus commented 1 year ago

@JoaquinDecima you can refer to this. But as soreau said, please join Matrix or IRC (search for #wayfire in libera.chat).

See you on the other side.