diff options
-rwxr-xr-x | .config/wmii-hg/rbar_acpi | 20 | ||||
-rwxr-xr-x | .config/wmii-hg/rbar_wifi | 5 |
2 files changed, 18 insertions, 7 deletions
diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi index 6348873..6e3e6e5 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 -bt | 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 -bt | + 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 } diff --git a/.config/wmii-hg/rbar_wifi b/.config/wmii-hg/rbar_wifi index dad4e61..3f222bd 100755 --- a/.config/wmii-hg/rbar_wifi +++ b/.config/wmii-hg/rbar_wifi @@ -16,7 +16,10 @@ update() { while true; do { printf 'label ' - iwinfo wlp2s0|grep -E '^(ESSID|Link Quality)='|sed 'N;s/\n/ | /' + { + iwinfo wlp2s0 | sed -rn 's@^(ESSID|Link Quality)=@@p' + ifdata -pa wlp2s0 + } | sed 'N;N;s/\n/|/g' } | write "$id" sleep 1 done |