summaryrefslogtreecommitdiff
path: root/dwm/Scripts/status.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dwm/Scripts/status.sh')
-rw-r--r--dwm/Scripts/status.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/dwm/Scripts/status.sh b/dwm/Scripts/status.sh
new file mode 100644
index 0000000..3d1eba4
--- /dev/null
+++ b/dwm/Scripts/status.sh
@@ -0,0 +1,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