I’m sure at some point we have all wanted to know what the weather forecast is but did not want to leave the safety of our SSH session. Well, now you can with a simple command.
Just enter this into your command line to install.
This version is now obsolete (still works just fine but is only supports 2 column output)
echo -e "\nfunction weather() { curl wttr.in/\$@?2n; }" >> ~/.bashrc
source ~/.bashrc
New Version that will return an expanded weather report if your session is wide enough (and incorporates WarHawks suggestion).
echo -e "\nfunction weather()\n{\nif [ \$COLUMNS -lt 125 ]\nthen\n curl wttr.in/\$@?2n\nelse\n curl wttr.in/\$@\nfi\n}" >> ~/.bashrc && source ~/.bashrc
To use just type ‘weather’ at the prompt and you will get the weather forecast for your current IP based location:
Scrolling up gets you this:
Should you wish to get the weather report for a different location … well, you can do that too!
Here’s the output for ‘weather NewYork’:
If you’re running a session that is nice and wide it will (now) return an expanded weather report.
In this example columns=132 and rows=43: