From 29c529f5c677ccfffee766c285c459f5a622cb1c Mon Sep 17 00:00:00 2001 From: Viktor Dragomiretskyy Date: Sat, 11 Jul 2020 05:38:31 +1200 Subject: [PATCH] Don't need to own a well-known bus name any more. Allow open-fprintd call our methods. --- dbus_service/dbus-service | 6 ++++-- dbus_service/io.github.uunicorn.Fprint.conf | 9 +++++++++ setup.py | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 dbus_service/io.github.uunicorn.Fprint.conf diff --git a/dbus_service/dbus-service b/dbus_service/dbus-service index fae5a1c..c2ab89e 100755 --- a/dbus_service/dbus-service +++ b/dbus_service/dbus-service @@ -161,9 +161,8 @@ if __name__ == '__main__': tls.trace_enabled = True bus = dbus.SystemBus() - bus_name = dbus.service.BusName('io.github.uunicorn.Fprint', bus) - svc = Device(bus_name) + svc = Device(bus) watcher = None def watch_cb(name): @@ -176,5 +175,8 @@ if __name__ == '__main__': mgr.RegisterDevice(svc) watcher = bus.watch_name_owner('net.reactivated.Fprint', watch_cb) + # Kick off the open-fprintd if it was not started yet + bus.get_object('net.reactivated.Fprint', '/net/reactivated/Fprint/Manager') + loop.run() diff --git a/dbus_service/io.github.uunicorn.Fprint.conf b/dbus_service/io.github.uunicorn.Fprint.conf new file mode 100644 index 0000000..ebc4fd1 --- /dev/null +++ b/dbus_service/io.github.uunicorn.Fprint.conf @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/setup.py b/setup.py index 8f0878d..c1f33a4 100755 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ setup(name='python-validity', ], data_files=[ ('share/python-validity/playground/', ['factory-reset.py', 'pair.py', 'prototype.py']), + ('share/dbus-1/system.d/', ['dbus_service/io.github.uunicorn.Fprint.conf']), ('lib/python-validity/', ['dbus_service/dbus-service']), ] )