Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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