mikaelbr / node-notifier

A Node.js module for sending notifications on native Mac, Windows and Linux (or Growl as fallback)
MIT License
5.72k stars 323 forks source link

Adding support for actions for notify-send version >=0.8.2 #445

Open marmul opened 2 months ago

marmul commented 2 months ago

Ubuntu 23.10 and Ubuntu 24.04 are shipped with notify-send and libnotify versions >=0.8.2, so it supports notification actions.

https://manpages.ubuntu.com/manpages/mantic/en/man1/notify-send.1.html

The "--action" option needs to be set multiple times if there are multiple actions. I hacked something together that does that. I also wanted to use events with those actions, but for some reason had to refactor NotifySend into an ES6 class to make it work.

Only tested on Ubuntu 24.04 so far. Hints and comments welcome.