Last active
December 26, 2015 23:58
-
-
Save thameera/7234017 to your computer and use it in GitHub Desktop.
countdown script
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 | |
# USAGE | |
# ./countdown <num of seconds> <msg> | |
# eg: | |
# ./countdown 300 Time to rock! | |
date1=$((`date +%s` + $1)); | |
shift | |
while [ "$date1" -ne `date +%s` ]; do | |
echo -ne "$(date --date @$(($date1 - `date +%s` - 19800 )) +%H:%M:%S)\r"; | |
done | |
notify-send 'Timer finished' "$*" | |
zenity --info --title "Timer finished" --text "$*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment