From 747214f3da281670cfe86dc99ad8b6e47408aa08 Mon Sep 17 00:00:00 2001 From: Pi-Yueh Chuang Date: Wed, 18 Dec 2019 16:39:48 -0500 Subject: [PATCH] configurable D-Bus blueman object path to fix #483 The path to object org.blueman.Mechanism was originally hard-coded to "/". But in some systems, the path may be "/org/blueman/mechanism". So this commit adds an extra parameter to configure the path. --- bumblebee/modules/bluetooth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/bluetooth.py b/bumblebee/modules/bluetooth.py index 949be09..a43f43b 100644 --- a/bumblebee/modules/bluetooth.py +++ b/bumblebee/modules/bluetooth.py @@ -5,6 +5,7 @@ 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) + * bluetooth.dbus_destination_path : dbus destination path (defaults to /) """ @@ -97,10 +98,11 @@ class Module(bumblebee.engine.Module): state = "true" dst = self.parameter("dbus_destination", "org.blueman.Mechanism") + dst_path = self.parameter("dbus_destination_path", "/") cmd = "dbus-send --system --print-reply --dest={}"\ - " / org.blueman.Mechanism.SetRfkillState"\ - " boolean:{}".format(dst, state) + " {} org.blueman.Mechanism.SetRfkillState"\ + " boolean:{}".format(dst, dst_path, state) bumblebee.util.execute(cmd)