Created
November 3, 2020 22:10
-
-
Save polaroidkidd/39bdd0c2041b0b9cc69d0be7d88590f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
BLUETOOTH_STATE=$(dbus-send --session --dest=org.blueman.Applet --print-reply=literal /org/blueman/applet org.blueman.Applet.GetBluetoothStatus | sed "s/^[[:space:]].*boolean //g") | |
if [ "${BLUETOOTH_STATE}" == "true" ]; then | |
dbus-send --session --dest=org.blueman.Applet --print-reply /org/blueman/applet org.blueman.Applet.SetBluetoothStatus boolean:false | |
else | |
dbus-send --session --dest=org.blueman.Applet --print-reply /org/blueman/applet org.blueman.Applet.SetBluetoothStatus boolean:true | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment