Created
September 9, 2014 11:58
-
-
Save jurre/a1ade23f7b42e8c3ccd7 to your computer and use it in GitHub Desktop.
omg-apple-keynote
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 | |
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