Setup notify-send click action

focusnotify-send

Given some simple notify-send command inside a bash script such as

notify-send "test"

How can I make a determinate window gain focus when the user clicks that notification? I thought playing around with the -a switch would do something, but I can't get it to work either on GNOME Shell and XFCE .

Best Answer

It seems notify-send can't do this. This Arch Linux thread provides more details as answer: https://bbs.archlinux.org/viewtopic.php?id=172965

taken from the link above:

No, notify-send doesn't support the use of actions/buttons.

Maybe this link will be useful for you : https://wiki.ubuntu.com/NotificationDesignGuidelines

it seems that the design guidelines don't recommend action buttons in notifications, rather recommend a popup window from the application if additional action is required/needed.

last but not least dunstify seems to support action buttons.

Related Question