18 lines
458 B
Bash
18 lines
458 B
Bash
#!/usr/bin/env bash
|
|
|
|
toggle() {
|
|
STATUS="$(bluetoothctl show | grep Powered | awk '{print $2}')"
|
|
if [ $STATUS == "yes" ]; then
|
|
bluetoothctl power off
|
|
notify-send -a "Bluetooth" --urgency=normal "Bluetooth" "Bluetooth has been turned off."
|
|
else
|
|
bluetoothctl power on
|
|
notify-send -a "Bluetooth" --urgency=normal "Bluetooth" "Bluetooth has been turned on."
|
|
fi
|
|
}
|
|
|
|
|
|
if [[ $1 == "--toggle" ]]; then
|
|
toggle
|
|
fi
|