From fd40e4ddaefc70acb2cedcbe69bce49077a62376 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Jan 2015 00:53:11 -0500 Subject: wmii: Make rbar way cooler --- .config/wmii-hg/rbar_acpi | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to '.config/wmii-hg/rbar_acpi') diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi index 1771875..bdcdf0f 100755 --- a/.config/wmii-hg/rbar_acpi +++ b/.config/wmii-hg/rbar_acpi @@ -1,15 +1,18 @@ #!/bin/bash -. include.sh -id=$1 -trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT +update() { + id=$1 + setup_trap "${id}.*" -while connected_to_x_server; 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" >> "${WMII_DIR}/rbar/${id}.${n}" - done - sleep 1 -done + 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 + sleep 1 + done +} + +. "$(dirname "$0")/rbar.sh" -- cgit v1.2.3-2-g168b