[modules/bluetooth] Make dbus destination configurable

Add a parameter "dbus_destination" that allows a user to specify the
DBUS destination.

fixes #483
This commit is contained in:
Tobias Witek 2019-12-14 13:36:45 +01:00
parent 2ed5e8e702
commit 9236b5279e

View file

@ -4,6 +4,7 @@ right click toggles bluetooth. Needs dbus-send to toggle bluetooth state.
Parameters: Parameters:
* bluetooth.device : the device to read state from (default is hci0) * bluetooth.device : the device to read state from (default is hci0)
* bluetooth.manager : application to launch on click (blueman-manager) * 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: else:
state = "true" 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"\ " / org.blueman.Mechanism.SetRfkillState"\
" boolean:{}".format(state) " boolean:{}".format(dst, state)
bumblebee.util.execute(cmd) bumblebee.util.execute(cmd)