Skip to content

Instantly share code, notes, and snippets.

@thameera
Last active December 26, 2015 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thameera/7234017 to your computer and use it in GitHub Desktop.
Save thameera/7234017 to your computer and use it in GitHub Desktop.
countdown script
#!/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