How to write notification displaying application?

Piotr Husiatyński piotrhusiatynski at gmail.com
Thu Apr 11 23:51:49 PDT 2013


Hi,
I'm trying to write an application that will display all notifications. I
want to register new service for the org.freedesktop.Notifications.
I searched for working examples, but I got stuck with nothing. So far, I'm
trying to have a working example using python 2.7. I'm sending messages
using notify-send and except of my broken script, all notification daemons
are working (receiving messages).
I will appreciate any help on that.

Here's what I'm doing:


import gtk
import dbus
from dbus.mainloop.glib import DBusGMainLoop

MATCH =
"type='method_call',interface='org.freedesktop.Notifications',member='Notify'"

def message_filter(connection, message):
    print(message)

def main():
    DBusGMainLoop(set_as_default=True)
    bus = dbus.SessionBus()
    bus.add_match_string(MATCH)
    bus.add_message_filter(message_filter)
    gtk.main()

if __name__ == "__main__":
    main()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20130412/a8af4a1a/attachment.html>


More information about the dbus mailing list