[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:
parent
2ed5e8e702
commit
9236b5279e
1 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue