summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/rbar_acpi
blob: 1771875fff54e396c67e33555f064a8735ab2a19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
. include.sh

id=$1
trap "rm -f ${WMII_DIR}/rbar/${id}.*" EXIT

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