[lorien420] try to start notif-daemon if not there
This commit is contained in:
parent
e0ba19f93c
commit
64f2ef7d0e
|
@ -47,10 +47,16 @@ def dbus_get_interface():
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
|
obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
|
||||||
dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus')
|
dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus')
|
||||||
#FIXME: this just disables notification-daemon for 99% of users
|
running_services = dbus_iface.ListNames()
|
||||||
#avail = dbus_iface.ListNames()
|
started = True
|
||||||
#if not interface in avail:
|
if interface not in running_services:
|
||||||
# return None
|
# 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)
|
obj = bus.get_object(interface, path)
|
||||||
return dbus.Interface(obj, interface)
|
return dbus.Interface(obj, interface)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
Loading…
Reference in New Issue