dunst-project / dunst

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

Custom indicators for URL and Actions #509

Open sweenu opened 6 years ago

sweenu commented 6 years ago

I'd love to have the opportunity to change my notifications' colors or frame if they have actions or URLs. Or at least, be able to change (A) and (U) to something else.

ismig commented 4 years ago

I find the (AU) fairly distracting. It's so large it dwarfs the appname of my notifications, which is deliberately small and grey. Small icons would be less distracting and easier to interpret -- maybe the link icon and something else for actions (a hammer? lol). Or just a custom format string.

Kryszak commented 4 years ago

Simply being able to set indicators to some other string stylable with HTML would be great!

tsipinakis commented 4 years ago

I have a faint memory of discussing this with @bebehei but I can't seem to find any logs of it.

How about adding conditionals to the format setting for this? For example the default format becomes something like %?action?(A)? %?url?(U)? %?both?(AU)?<b>%s</b>\n%b

Though I don't like that we have to use both as well to keep the behaviour consistent. This also raises the question of how to add this without breaking indicators for all existing configs.

bebehei commented 4 years ago

@tsipinakis Yeah, we had been discussing previously about this. But I'm not sure, where. I know I had been starting to implement similar stuff with a date field (IIRC I closed this PR because I didn't find an acceptable solution).

monkz commented 2 years ago

For my part, i would like to customize them, to add the count of actions that is bound to a notification - Like A3. And for U replace it with a emoji.

Scripting does not solve this, as actions are not available there.

elamperti commented 1 year ago

Hi everyone, I've drafted a PR with changes to have custom indicators. I tried it with emoji and it works (and looks quite nice!). The indicators can be styled in the format string using Pango markup.

I'd love to hear your feedback about the implementation.


@tspinakis from what I saw in the code, having conditionals in the format string would be probably difficult to implement (and/or would end up requiring an ugly syntax), so I'd discard that for now.

@monkz this implementation doesn't show the number of actions or URLs, it could be added but I don't know if it would be generally useful. What would be a use case that favors knowing the number of actions at first glance?

monkz commented 1 year ago

@elamperti This allows me to determine if I need the context menu or just a click on the notification.

For instance - a sip application rings and notifies the user about a call. Actions would be Accept, Decline and Ignore. - But I don't know about the other Options, because I just see "ah - there is an action if I click this" - not "ah - there are multiple actions possible - I should invoke the context menu on this notification"

Always calling the context menu seems cumbersome. This would not be needed if https://github.com/dunst-project/dunst/issues/234 is possible.