Difference between revisions of "Dunstify"

From ArchWiki
Jump to navigation Jump to search
(Write Notification id section)
(Add actions section)
Line 19: Line 19:
 
Furthermore you can close a notification by using {{ic|1=dunstify --close=ID}}.
 
Furthermore you can close a notification by using {{ic|1=dunstify --close=ID}}.
  
 +
==Actions==
 +
You can define actions which can be invoked directly from the notification by specifying one ore more {{id|1=--action=action,label}} parameters.
 +
For instance:
 +
dunstify --action="replyAction,reply" "Message received"
 +
 +
The user can then access the specified actions via dunsts context menu.
 +
The call to dunstify will block until either the notification disappears or an action is selected.
 +
In the former case dunstify will return 1 if the notification timed out and 2 if it was closed manually.
 +
In the latter case it returns the action which was selected.
  
 
==Tips and tricks==
 
==Tips and tricks==
 
Some more content
 
Some more content

Revision as of 22:14, 31 December 2018

Dunstify is an alternative to the notify-send command which is completely compatible to notify-send and can be used alongside it, but offers some more features. Dunstify works only with the Dunst notification daemon.

Additionally to the options available in notify-send, dunstify offers some more features like IDs and actions.

Installation

Dunstify is available through the AUR. Simply install the dunstifyAUR package.

Notification ID

You can assign an ID to a notification by calling dunstify with the -r ID option, where ID needs to be an integer. If a notification with that ID already exists it will be replaced with the new one(therefore the long option name --replace=ID).

Furthermore you can close a notification by using dunstify --close=ID.

Actions

You can define actions which can be invoked directly from the notification by specifying one ore more Template:Id parameters. For instance:

dunstify --action="replyAction,reply" "Message received"

The user can then access the specified actions via dunsts context menu. The call to dunstify will block until either the notification disappears or an action is selected. In the former case dunstify will return 1 if the notification timed out and 2 if it was closed manually. In the latter case it returns the action which was selected.

Tips and tricks

Some more content