We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0d3e0b commit a7e6920Copy full SHA for a7e6920
configs/i3/block-scripts/battery.sh
@@ -1,8 +1,7 @@
1
#!/bin/sh
2
3
warn_state_file=/tmp/.battery-warning-notification-id
4
-search='Battery 0: '
5
-full_text=$(acpi -b | grep "^$search" | cut -d: -f2-)
+full_text=$(acpi -b | grep -vF 'rate information unavailable' | head -1 | cut -d: -f2-)
6
status=$(echo "$full_text" | cut -d, -f1 | sed -e 's/^[[:space:]]*//')
7
pct=$(echo "$full_text" | cut -d, -f2 | sed s/%// | tr -d '[:space:]')
8
if ! echo "$full_text" | grep -qF -e 'rate information unavailable' -e 'zero rate'; then
0 commit comments