fix headphones charge in i3blocks
This commit is contained in:
parent
640fc6d089
commit
845f83c3e0
@ -80,15 +80,8 @@ cmd_pomodoro() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd_bluetooth_battery() {
|
cmd_bluetooth_battery() {
|
||||||
for uuid in $(timeout 1 bluetoothctl devices | cut -f2 -d' ' 2>/dev/null)
|
device="$(upower -e | grep headset | head -1)"
|
||||||
do
|
upower -i "${device}" | grep percentage | awk '{ print "🎧🔋"$2"" }'
|
||||||
device_info="$(timeout 1 bluetoothctl info "${uuid}")"
|
|
||||||
|
|
||||||
if echo "${device_info}" | grep -q 'Connected: yes\|Battery Percentage'; then
|
|
||||||
echo "${device_info}" | grep 'Battery Percentage' | awk -F '[()]' '{ print "🎧🔋"$2"%" }'
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_language() {
|
cmd_language() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user