1

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?

ptomato
  • 56,175
  • 13
  • 112
  • 165

1 Answers1

1

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 :)

Gnosophilon
  • 1,340
  • 7
  • 24
  • But there is a way to read a message send by another programm, like pidgin with a callback or something like that? –  May 25 '12 at 13:55
  • @EliasGranja Sorry, I misread your question initially and added some details just now. – Gnosophilon May 25 '12 at 14:07