dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.42k stars 338 forks source link

How to disable icons in `dunstify` #1358

Open eeeXun opened 1 month ago

eeeXun commented 1 month ago

Issue description

I set enable_recursive_icon_lookup to true in my dunstrc. After version 1.11.0, the icon is alway displayed in dunstify command. Like

dunstify "Hello"

image

In some cases, I don't want to show the icon in dunstify command. I've checked the dunstify --help menu, there doesn't seem to be a flag, like --no-icon, to disable the icon.

Installation info

Minimal dunstrc ```ini [global] enable_recursive_icon_lookup = true ```
bynect commented 1 month ago

At the moment the icon have some default value (for historical reason I guess) (The code responsible for this is at https://github.com/dunst-project/dunst/blob/20033b86595c3967a20a476065443e515e39ac63/src/settings_data.h#L368. )

Can you try doing

[urgency_low]
icon =
default_icon = 

Otherwise I you just don't want icon you can set icon_position=off

PS: I noticed afterwards that you asked to do it in dunstify

there are two ways I can think of. One is to create a rule for a custom category to disable icons and using that category from dunstify

the other is passing an invalid icon path to dunstify -i GIBRISH

eeeXun commented 1 month ago

Oh, I don't know that's the default behavior.

And I found out that my problem was not caused by dunst 1.11.0, but by updating adwaita-icon-theme from 46.0 to 46.2. (Maybe the version before 46.2 is missing some icons. So I haven't encountered this problem before.)

there are two ways I can think of. One is to create a rule for a custom category to disable icons and using that category from dunstify

the other is passing an invalid icon path to dunstify -i GIBRISH

Yes, these could be the workaround for me. But could I request a feature of --no-icon flag or something like that in dunstify command? If this is not planned, feel free to close this issue.

NicolasWebDev commented 3 weeks ago

I have the same issue you're mentioning @eeeXun , since a system upgrade yesterday a default icon began to appear in my notifications. It must be a theme package that got upgraded because dunst itself was not upgraded.

Even though we can now set icon_position=off globally and in the rules (as mentionned in #1010 ), it's not really practical in my case because I just want to disable the default icon. If an icon is passed, then use that icon. So a flag for that would be quite useful indeed.

bynect commented 3 weeks ago

I have the same issue you're mentioning @eeeXun , since a system upgrade yesterday a default icon began to appear in my notifications. It must be a theme package that got upgraded because dunst itself was not upgraded.

Even though we can now set icon_position=off globally and in the rules (as mentionned in #1010 ), it's not really practical in my case because I just want to disable the default icon. If an icon is passed, then use that icon. So a flag for that would be quite useful indeed.

I'm planning to make it an option to disable this. Anyway you can set icon_position=off to specific notifications (in rules). From the dunstify command just pass a nonexistent icon with the -i flag

bynect commented 4 days ago

I have to correct myself. The right way to remove icon from dunstrc is doing new_icon =. Anyway I made a pr to fix this problem at the root