Dunst: Custom global actions

Created on 25 Oct 2019  路  2Comments  路  Source: dunst-project/dunst

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.

Feature

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bebehei picture bebehei  路  4Comments

adihrustic picture adihrustic  路  3Comments

existme picture existme  路  4Comments

chronus7 picture chronus7  路  5Comments

chhajedji picture chhajedji  路  4Comments