Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applying new_icon to one rules changes for all #658

Closed
rudevdr opened this issue Aug 30, 2019 · 3 comments · Fixed by #1017
Closed

applying new_icon to one rules changes for all #658

rudevdr opened this issue Aug 30, 2019 · 3 comments · Fixed by #1017

Comments

@rudevdr
Copy link

rudevdr commented Aug 30, 2019

I was looking to disable icon for all application, except one. I was looking to set icon_position via rule but its not available (relevent issue: #638). I tried to get workaround the issue by setting icon_position = left in global and use new_icon in rules. Then I caught this issue.

My dunstrc is something like this.

[global]

icon_position = left

[my-app]
	appname = myapp
	summary = "*"
	timeout = 0

[fix-icon]
	summary = "*"
	new_icon = ""

Expected Behaviour

Only notifications from myapp should display the icon and other icons should not show icon at all.

Actual Behaviour

No icon in all notifications. If new_icon = "" rule is removed, then icon in all notifications is shown.


It looks like setting new_icon = "" in one rule does not respect icon supplied to a notification in all notifications and sets them all to null.

@tsipinakis
Copy link
Member

This is working as intended. Rules do not override each other and are checked independently. So in this case what happens is

  • All notifications with appname = myapp have their timeout set to 0
  • All notifications have their icons disabled

Unfortunately I don't think there are any workarounds to achieve this currently, at least without listing all appnames. For a proper solution subscribe to #645, which should allow more advanced match syntax if it's added.

@rudevdr
Copy link
Author

rudevdr commented Aug 30, 2019

Rules do not override each other and are checked independently.

Ah, I get it now. Thanks for explaining.

As you mentioned in #645, fnmatch would solve this issue. I could change to:

[my-app]
	appname = myapp
	summary = "*"
	timeout = 0

[fix-icon]
	appname = "!myapp"
	summary = "*"
	new_icon = ""

and this will solve this issue.

But still it will be a workaround. Implementing solution mentioned in #638 would be perfect solution for this workaround.

I will close it once fnmatch is supported. But if you think it should be close, please go ahead and close it.

fwsmit added a commit to fwsmit/dunst that referenced this issue Jan 15, 2022
This enables more advanced regular expression syntax. It can be enabled
with `enable_posix_regex`.

Fixes: dunst-project#1013
Fixes: dunst-project#645
Fixes: dunst-project#658
fwsmit added a commit to fwsmit/dunst that referenced this issue Jan 15, 2022
This enables more advanced regular expression syntax. It can be enabled
with `enable_posix_regex`.

Fixes: dunst-project#1013
Fixes: dunst-project#645
Fixes: dunst-project#658
fwsmit added a commit to fwsmit/dunst that referenced this issue Jan 16, 2022
This enables more advanced regular expression syntax. It can be enabled
with `enable_posix_regex`.

Fixes: dunst-project#1013
Fixes: dunst-project#645
Fixes: dunst-project#658
@fwsmit
Copy link
Member

fwsmit commented Jan 16, 2022

Regex is implemented in #1017. It should be better than fnmatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants