Caspar Clemens Mierau recently wrote about a nifty Debian package named weather-util and his method for embedding the current temperature into the screen status bar. Quite nifty. I did the same with one small exception, including the predicted probability of precipitation if it exists.
My one liner that runs from cron (split to multiple lines for readability):
1 2 3 4 5
More details on the full implementation in the original post over at Caspar Clemens Mierau’s blog. And yes, I stole his loadavg stuff too ;)
Silly me, upon further investigation, two things to note. First, the -i option applies only to current conditions and not to the forecast. In my case I actually want weather -f ACY and /etc/weatherrc takes care of the rest. Secondly, the field number for the precipitation percentage changes, oops. I’ve correctly accounted for this in the updated awk script above.
After making these changes I decided the awk script was getting a bit long for a single line so I went all out creating ~/bin/weather.awk:
1 2 3 4 5 6 7 8 9 10
My crontab entry now looks like:
*/5 * * * * weather -f ACY | /home/michael/bin/weather.awk > /home/michael/.weather