summaryrefslogtreecommitdiff
path: root/dwm/Scripts/status.sh
blob: 3d1eba47dd305af64e1da30bff340444946ce623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
PIDFILE=/tmp/stat.pid
STATUSFILE=/tmp/dsbMain

kill `cat $PIDFILE`
if [ $? -eq 0 ]; then
	echo "Shutting down"
	rm $STATUSFILE
	exit
fi

echo $$ > $PIDFILE

while true; do

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

	echo "$IP $TIME $BATT%" > $STATUSFILE
	sleep 10
done