Is there a way to add a custom global action that would be present in all notifications? I would like to add a copy action which would copy the text of the notification to my clipboard. For notifications created by me I would be able to specify a script and add this action, but most notifications on my system are not initiated by me.
Hi, this is not possible as actions are something the client (read: the program that sent the notification) does, the logic isn't being run on dunst, we only send back the action that was chosen.
However it might be a good idea to consider custom "actions" which in reality are scripts which are called in similar way to the script= directive in dunstrc. I'll leave this open for discussion as a feature request.
I'm looking for the same functionality as well. Use case:
I'd like to add a notification action to copy OTP codes from SMS messages. Given the notification text, a simple regex to match consecutive digits will probably work fine for me. So I could add a custom action to process the notification content and copy OTP codes to the clipboard.
Most helpful comment
Hi, this is not possible as actions are something the client (read: the program that sent the notification) does, the logic isn't being run on dunst, we only send back the action that was chosen.
However it might be a good idea to consider custom "actions" which in reality are scripts which are called in similar way to the
script=directive in dunstrc. I'll leave this open for discussion as a feature request.