.nix/scripts/toggle_bluetooth
2024-07-28 22:06:28 +02:00

11 lines
251 B
Bash

#!/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