Created
February 27, 2014 01:41
-
-
Save chuckwagoncomputing/9242607 to your computer and use it in GitHub Desktop.
Selects the proper xkcd now image file for the time.
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 | |
# Change this to the directory containing the image files. | |
XKCDPATH="/usr/local/bin/xkcdnow" | |
HOUR=$(TZ=Asia/Kamchatka date +%H) | |
MINUTE=$(date +%M) | |
if [ $MINUTE -gt 00 -a $MINUTE -le 15 ]; then | |
MINUTE=15 | |
elif [ $MINUTE -gt 15 -a $MINUTE -le 30 ]; then | |
MINUTE=30 | |
elif [ $MINUTE -gt 30 -a $MINUTE -le 45 ]; then | |
MINUTE=45 | |
elif [ $MINUTE -gt 45 -o $MINUTE = 00 ]; then | |
MINUTE=00 | |
fi | |
echo $XKCDPATH$HOUR"h"$MINUTE"m.png" | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment