Created
July 31, 2020 00:23
-
-
Save joshpetit/1395caa532249082a69bca5935d815ec to your computer and use it in GitHub Desktop.
Script to toggle bluetooth on and off, I add a shortcut in the settings so I can quickly run it.
This file contains hidden or 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
#!/bin/bash | |
output=$(bluetoothctl show | sed -n -e 's/^.*Powered: //p') | |
if [[ $output = no ]]; then | |
bluetoothctl power on | |
notify-send -h int:transient:1 "Bluetooth" "On" | |
else | |
bluetoothctl power off | |
notify-send -h int:transient:1 "Bluetooth" "Off" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment