diff --git a/scripts/deluge b/scripts/deluge index 81e9358d6..fd4103165 100755 --- a/scripts/deluge +++ b/scripts/deluge @@ -35,11 +35,23 @@ parser.add_option("--tray", dest="tray", help="start Deluge hidden in system tra (options, args) = parser.parse_args() import dbus +dbus_version = getattr(dbus, 'version', (0,0,0)) +if dbus_version >= (0,41,0) and dbus_version < (0,80,0): + import dbus.glib +elif dbus_version >= (0,80,0): + from dbus.mainloop.glib import DBusGMainLoop + DBusGMainLoop(set_as_default=True) +else: + pass + bus = dbus.SessionBus() + dbus_objects = dbus.Interface(bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'), 'org.freedesktop.DBus').ListNames() +print dbus_objects + interface = None if not "org.deluge_torrent.Deluge" in dbus_objects: