diff options
Diffstat (limited to 'home/.config/i3/status/bluetooth')
-rwxr-xr-x | home/.config/i3/status/bluetooth | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/home/.config/i3/status/bluetooth b/home/.config/i3/status/bluetooth index 3c2f9f1..d0c84be 100755 --- a/home/.config/i3/status/bluetooth +++ b/home/.config/i3/status/bluetooth @@ -1,6 +1,19 @@ #!/bin/bash -if (/usr/sbin/rfkill list bluetooth --output SOFT,HARD --noheadings \ - | grep -w blocked --quiet); then + +is_blocked() { + /usr/sbin/rfkill list bluetooth --output SOFT,HARD --noheadings \ + | grep -w blocked --quiet +} + +if [[ -n $BLOCK_BUTTON ]]; then + if is_blocked; then + /usr/sbin/rfkill unblock bluetooth + else + /usr/sbin/rfkill block bluetooth + fi +fi + +if is_blocked; then echo "OFF" echo "blocked" else |