diff options
Diffstat (limited to 'dwm/.dwmSession.sh')
-rwxr-xr-x | dwm/.dwmSession.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dwm/.dwmSession.sh b/dwm/.dwmSession.sh new file mode 100755 index 0000000..2c427b8 --- /dev/null +++ b/dwm/.dwmSession.sh @@ -0,0 +1,20 @@ +#!/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") + IP=$(hostname -i) + + xsetroot -name "$IP $TIME $BATT%" + sleep 10 +done |