Skip to content

Instantly share code, notes, and snippets.

@carneeki
Created January 31, 2017 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carneeki/92674b43e4a2caf3b3a86a96b0539564 to your computer and use it in GitHub Desktop.
Save carneeki/92674b43e4a2caf3b3a86a96b0539564 to your computer and use it in GitHub Desktop.
bashrc for weather updates with wttr.in
# 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