summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/rbar_acpi
blob: 2e9f3d4e9dbc0e63984b2270f92433de8e98804a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

update() {
	id=$1
	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
		sleep 1
	done
}

. "$(dirname "$0")/rbar.sh"