Created
March 28, 2011 11:28
-
-
Save punchagan/890313 to your computer and use it in GitHub Desktop.
Update pidgin status message periodically with a countdown timer.
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/bash | |
upto=`date -d "Mar 30 14:30" +%s` | |
text="to go!" | |
while true; do | |
now=`date +%s` | |
count=`expr $upto - $now` | |
hours=`expr $count / 3600` | |
minutes=`expr $count % 3600 / 60` | |
if [ "$hours" -gt "0" ] ; then | |
if [ "$minutes" -gt "0" ] ; then | |
msg=$hours" Hour(s) "$minutes" Minute(s) "; | |
else | |
msg=$hours" Hour(s) "; | |
fi | |
else | |
msg=$minutes" Minute(s) "; | |
fi | |
status=$msg$text | |
echo $status | |
`purple-remote setstatus?message="$status"` | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment