From 9236b5279ecd2a6a7777c61b4053ab5b031e7ab9 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 14 Dec 2019 13:36:45 +0100 Subject: [PATCH] [modules/bluetooth] Make dbus destination configurable Add a parameter "dbus_destination" that allows a user to specify the DBUS destination. fixes #483 --- bumblebee/modules/bluetooth.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/bluetooth.py b/bumblebee/modules/bluetooth.py index 8e54b56..949be09 100644 --- a/bumblebee/modules/bluetooth.py +++ b/bumblebee/modules/bluetooth.py @@ -4,6 +4,7 @@ right click toggles bluetooth. Needs dbus-send to toggle bluetooth state. Parameters: * bluetooth.device : the device to read state from (default is hci0) * bluetooth.manager : application to launch on click (blueman-manager) + * bluetooth.dbus_destination : dbus destination (defaults to org.blueman.Mechanism) """ @@ -95,9 +96,11 @@ class Module(bumblebee.engine.Module): else: state = "true" - cmd = "dbus-send --system --print-reply --dest=org.blueman.Mechanism"\ + dst = self.parameter("dbus_destination", "org.blueman.Mechanism") + + cmd = "dbus-send --system --print-reply --dest={}"\ " / org.blueman.Mechanism.SetRfkillState"\ - " boolean:{}".format(state) + " boolean:{}".format(dst, state) bumblebee.util.execute(cmd)