summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/rbar_acpi
diff options
context:
space:
mode:
Diffstat (limited to '.config/wmii-hg/rbar_acpi')
-rwxr-xr-x.config/wmii-hg/rbar_acpi18
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/wmii-hg/rbar_acpi b/.config/wmii-hg/rbar_acpi
new file mode 100755
index 0000000..bdcdf0f
--- /dev/null
+++ b/.config/wmii-hg/rbar_acpi
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+update() {
+ id=$1
+ 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
+ sleep 1
+ done
+}
+
+. "$(dirname "$0")/rbar.sh"