Closed cristianmiranda closed 4 years ago
Relace dunst scripting with a better and more solid approach using DBus notifications.
dunst
See https://askubuntu.com/questions/89279/listening-to-incoming-libnotify-notifications-using-dbus
import glib import dbus from dbus.mainloop.glib import DBusGMainLoop def print_notification(bus, message): keys = ["app_name", "replaces_id", "app_icon", "summary", "body", "actions", "hints", "expire_timeout"] args = message.get_args_list() if len(args) == 8: notification = dict([(keys[i], args[i]) for i in range(8)]) print notification["app_name"], notification["summary"], notification["body"] loop = DBusGMainLoop(set_as_default=True) session_bus = dbus.SessionBus() session_bus.add_match_string("type='method_call',interface='org.freedesktop.Notifications',member='Notify',eavesdrop=true") session_bus.add_message_filter(print_notification) glib.MainLoop().run()
Covered on #4
Relace
dunst
scripting with a better and more solid approach using DBus notifications.See https://askubuntu.com/questions/89279/listening-to-incoming-libnotify-notifications-using-dbus