1
0
Fork 0
dotfiles/.config/eww/scripts/bluetooth
Lucas Sta Maria e9aebfbb15
fix(eww): indicate when bluetooth is off
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
2024-02-23 14:49:34 -05:00

10 lines
306 B
Bash
Executable file

#!/usr/bin/env bash
powered=$(bluetoothctl show | grep -i "powered" | grep -i "yes" | wc -l)
if [[ "$powered" -eq 1 ]]; then
val=$(bluetoothctl devices Connected | wc -l)
echo "(label :class \"bluetooth__label\" :text \"$val\")"
else
echo "(label :class \"bluetooth__label\" :text \"-\")"
fi