dunst-project / dunst

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

Modify all notification properties from script/rules #899

Open emptymess opened 3 years ago

emptymess commented 3 years ago

When using rules with messaging apps like Rochet.Chat, I would like to be able to capture specific notifications using wildcards and setting stack tags according to the trigger, e.g :

[my-app]
    summary = "example-summary*"
    set_stack_tag = "%s"

Notification > example-summary-foobar Stack tag >> example-summary-foobar

or even :

[my-app]
    summary = "ex(am)ple-summary-(*)"
    set_stack_tag = "%1-%2"

Notification > example-summary-foobar Stack tag >> am-foobar

This would allow modifying notifications dynamically with the help of just one rule and without scripting.

fwsmit commented 3 years ago

This would allow modifying notifications dynamically with the help of just one rule and without scripting.

I'd say there's nothing wrong with scripting for these more advanced use cases. The problem is that I believe one can't modify the notification's stack tag or any other properties from a script.

emptymess commented 3 years ago

Well technically from script you could take the properties of a notification, process those properties, kill the processed notification from id and then spawn a corrected notification although it seems a bit overkill.

fwsmit commented 3 years ago

Yeah editing a notification's properties from the script seems like the right choice here. It's not something I'm planning to implement soon tho