diff options
Diffstat (limited to '.config/wmii-hg/rbar_acpi')
-rwxr-xr-x | .config/wmii-hg/rbar_acpi | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi index 2e9f3d4..24742f8 100755 --- a/.config/wmii-hg/rbar_acpi +++ b/.config/wmii-hg/rbar_acpi @@ -5,12 +5,20 @@ update() { setup_trap "${id}.*" while true; do - acpi -t | sed -r \ - -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ - -e 's/\s*degrees\s*/°/g' | - cat -n | while read -r n line; do - printf "label %s\n" "$line" | write "${id}.${n}" - done + acpi -t | + sed -r \ + -e 's/^([A-Z])[a-z]+ ([0-9]+):/\1\2:/' \ + -e 's/\s*degrees\s*/°/g' \ + -e 's/Charging,\s*/↑/g' \ + -e 's/Discharging,\s*/↓/g' \ + -e 's/Unknown,\s*/?/g' \ + -e 's/\s*remaining//g' \ + -e 's/\s*until charged//g' \ + -e 's/charging at zero rate - will never fully charge./∞/g' \ + -e 's/\s*ok,\s*//g' | + cat -n | while read -r n line; do + printf "label %s\n" "$line" | write "${id}.${n}" + done sleep 1 done } |