.files/.config/waybar/scripts/toggle_bluetooth

12 lines
251 B
Text
Raw Permalink Normal View History

2024-10-17 15:16:09 +00:00
#!/usr/bin/env bash
# Check the current Bluetooth power state
state=$(bluetoothctl show | grep "Powered:" | awk '{print $2}')
# Toggle Bluetooth power state
if [ "$state" == "yes" ]; then
bluetoothctl power off
else
bluetoothctl power on
fi