From 64f2ef7d0eaeec0baf5e4c7a69844aeddda05bc4 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 23 Nov 2005 17:44:32 +0000 Subject: [PATCH] [lorien420] try to start notif-daemon if not there --- src/notify.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/notify.py b/src/notify.py index fa4376cbd..a4e32c424 100644 --- a/src/notify.py +++ b/src/notify.py @@ -47,10 +47,16 @@ def dbus_get_interface(): bus = dbus.SessionBus() obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus') - #FIXME: this just disables notification-daemon for 99% of users - #avail = dbus_iface.ListNames() - #if not interface in avail: - # return None + running_services = dbus_iface.ListNames() + started = True + if interface not in running_services: + # try to start the service (notif-daemon) + if dbus_iface.StartServiceByName(interface,dbus.UInt32(0)) == 1: + started = True + else: + started = False + if not started: + return None obj = bus.get_object(interface, path) return dbus.Interface(obj, interface) except Exception, e: