# Set up Bluetooth toggling via keyboard shortcut **Category:** [blog](https://bawmedical.co.uk/c/blog/9) **Created:** 2020-06-09 19:18 UTC **Views:** 1332 **Replies:** 0 **URL:** https://bawmedical.co.uk/t/set-up-bluetooth-toggling-via-keyboard-shortcut/163 --- ## Post #1 by @marcusbaw Based on this Gist https://gist.github.com/konchunas/265adbc4974c0559a374f0e7d3cbe17f#file-toggle-dbus-bluetooth-sh It didn't work on Linux Mint, but this variant did ```bash #!/bin/sh IS_BLUETOOTH_ON=$(dbus-send --system --dest=org.bluez --print-reply /org/bluez/hci0 org.freedesktop.DBus.Properties.Get string:org.bluez.Adapter1 string:Powered ) case $IS_BLUETOOTH_ON in *false*) rfkill unblock 0 ;; *true*) rfkill block 0 ;; esac exit 0 ``` I saved this to a file (in my case in `~/code/scripts/bluetooth-toggle.sh` ) and made it executable with `chmod +x ~/code/scripts/bluetooth-toggle.sh` . Then I assigned this to run via a keyboard shortcut using the GUI keyboard management tool --- **Canonical:** https://bawmedical.co.uk/t/set-up-bluetooth-toggling-via-keyboard-shortcut/163 **Original content:** https://bawmedical.co.uk/t/set-up-bluetooth-toggling-via-keyboard-shortcut/163