Skip to content

Instantly share code, notes, and snippets.

@jurre
Created September 9, 2014 11:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jurre/a1ade23f7b42e8c3ccd7 to your computer and use it in GitHub Desktop.
Save jurre/a1ade23f7b42e8c3ccd7 to your computer and use it in GitHub Desktop.
omg-apple-keynote
#!/bin/bash
formatted_time() {
local total_seconds=${1}
((hours=total_seconds/3600))
((minutes=total_seconds%3600/60))
((seconds=total_seconds%60))
printf "%02d:%02d:%02d\n" $hours $minutes $seconds
}
clear
endsec=`date -j -f '%d %b %Y %T' "9 Sep 2014 19:00:00" +%s`
nowsec=`date +%s`
difsec=$((endsec-nowsec))
while [ $difsec -gt 0 ]
do
tput cup 0 0
echo -n "Keynote starts in: "
formatted_time "$difsec"
sleep 1
nowsec=`date +%s`
difsec=$((endsec-nowsec))
done
echo 'OMG OMG OMG IWATCH!!11!!11eleven!1!1!!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment