2024-01-25 14:39:08 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
info (){
|
|
|
|
power=$(bluetoothctl show | grep Powered | awk '{print $2}' | sed 's/yes/on/g; s/no/off/g')
|
|
|
|
count=$(bluetoothctl devices Connected | wc -l)
|
|
|
|
echo "{\"power\": \"${power}\", \"count\": \"${count}\"}"
|
|
|
|
}
|
|
|
|
|
|
|
|
info
|
2024-01-27 19:10:53 +01:00
|
|
|
dbus-monitor --system "sender=:1.3" | while read -r line; do
|
2024-01-25 14:39:08 +01:00
|
|
|
info
|
|
|
|
done
|