Last active
May 31, 2016 23:15
-
-
Save kakwa/36b43fa51ab7e84bf43b80e6acc39a36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
get_state() { | |
f=`grep "flags" /proc/pmu/battery_0 | sed 's/.*:\ //'` | |
if [ $f -eq 00000011 ] | |
then | |
echo "<" | |
elif [ $f -eq 00000013 ] | |
then | |
echo ">" | |
else | |
echo "=" | |
fi | |
} | |
get_time() { | |
d=`grep "time" /proc/pmu/battery_0 | sed 's/.*:\ //'` | |
date -d@$d -u +%H:%M:%S | |
} | |
while true | |
do | |
xsetroot -name "`get_state` `get_time` | `date +%d/%m/%y` `date +%H:%M`" | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment