Skip to content

Instantly share code, notes, and snippets.

@rsepassi
Created May 8, 2014 23:33
Show Gist options
  • Select an option

  • Save rsepassi/51129804cd6fae107a84 to your computer and use it in GitHub Desktop.

Select an option

Save rsepassi/51129804cd6fae107a84 to your computer and use it in GitHub Desktop.
# Countdown
function countdown(){
echo "Countdown started: $1 minutes"
background_countdown $1 &
}
function background_countdown(){
date1=$((`date +%s` + $1 * 60));
while [ "$date1" -ge `date +%s` ]; do
:
done
terminal-notifier -message "Time's up. $1 minutes passed."
#for i in `seq 1 3`; do
#echo -en "\007" # beep
#done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment