Read Gnome Shell Notifications
-
10-06-2021 - |
Pregunta
I need to read the gnome-shell notifications to send an e-mail whenever event X happens (like a torrent was successfully downloaded). Is there a file or a callback that I can read/set in C code?
Solución
A very easy option would be to call the notify-send
tool from your code. It is used like this:
notify-send [OPTION...] <SUMMARY> [BODY] - create a notification
For more information, see the accompanying man-page.
Edit: I first read this question wrong and thought you wanted to send notifications. For reacting to notifications, I would suggest writing a gnome-shell
extension. There is already an example extension that shows how to react to all notifications.
I am not aware of any callbacks for your own code, sorry. But you could probably roll your own notification callback via DBUS
. See the DBUS homepage for more details. In short, your shell extension could generate an appropriate DBUS
message, to which your program then could react.
Sorry for my reading error :)