|
|
@ -3,17 +3,18 @@ |
|
|
|
|
|
|
|
|
|
|
|
case $1 in |
|
|
|
case $1 in |
|
|
|
"") |
|
|
|
"") |
|
|
|
if [ "$(bluetoothctl show | grep "Powered: yes" | wc -c)" -eq 0 ]; then |
|
|
|
bt_color="" |
|
|
|
printf "%s\n" "%{F#66ffffff}" |
|
|
|
if bluetoothctl show | grep -q "Powered: no"; then |
|
|
|
elif [ "$(printf "%s\n" info | bluetoothctl | grep 'Device' | wc -c)" -eq 0 ]; then |
|
|
|
bt_color="%{F#66ffffff}" |
|
|
|
printf "%s\n" "" |
|
|
|
elif bluetoothctl info | grep -q "Device"; then |
|
|
|
printf "%s\n" "%{F#2193ff}" |
|
|
|
bt_color="%{F#2193ff}" |
|
|
|
else |
|
|
|
else |
|
|
|
printf "%s\n" "%{F#2193ff}" |
|
|
|
: |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
printf "%s%s\n" "$bt_color" "" |
|
|
|
;; |
|
|
|
;; |
|
|
|
"--toggle") |
|
|
|
"--toggle") |
|
|
|
if [ "$(bluetoothctl show | grep "Powered: yes" | wc -c)" -eq 0 ]; then |
|
|
|
if bluetoothctl show | grep -q "Powered: no"; then |
|
|
|
bluetoothctl power on |
|
|
|
bluetoothctl power on |
|
|
|
else |
|
|
|
else |
|
|
|
bluetoothctl power off |
|
|
|
bluetoothctl power off |
|
|
|