Created
January 31, 2017 02:45
-
-
Save carneeki/92674b43e4a2caf3b3a86a96b0539564 to your computer and use it in GitHub Desktop.
bashrc for weather updates with wttr.in
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
# Add a function to get weather refreshed every ten minutes to terminal | |
# using wttr.in. Can be used as follows: | |
# wttr Arlen # Fictional town in Texas | |
# wttr KSGF # ICAO code for Springfield, Missouri | |
# wttr # Use a default location in code below | |
# | |
# See wttr.in/:help for more details | |
wttr() | |
{ | |
tmpfile=$(mktemp /tmp/wttr.XXXXXX) | |
while true; do | |
curl wttr.in/"${1:-Sydney}" -s | head -n 7 > $tmpfile; | |
clear; | |
cat $tmpfile; | |
sleep 600; | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment