summaryrefslogtreecommitdiff
path: root/.dwmSession.sh
blob: 5e9b4e34497768d3750cd4ac25bf9dd4734a74a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
PIDFILE=/home/julian/.dwmSession.pid

kill `cat $PIDFILE`

if [ "$1" = "-e" ]; then
	exit
fi

echo $$ > $PIDFILE

while true; do

	BATT=$( acpi -b | sed 's/.*[charging|unknown], \([0-9]*\)%.*/\1/gi' )
	TIME=$(/bin/date +"%H:%M")

	xsetroot -name "$TIME $BATT%"
	sleep 10
done