So I’ve found the cleanest and easiest way to put weather updates on my desktop with my Macintosh using geektool utility. Below is a screenshot of my desktop for reference:
This is achieved with three simple geektool “Shell” items, these three items properly aligned provide the results shown above.
For the date utilize the command:
date +”%a, %b %d %Y”
This will provide the results required. This can be tweaked if you are familiar with the date command or you can learn about the date command from the man page.
For the current weather utilize the command:
curl –silent “http://xml.weather.yahoo.com/forecastrss?p=LOCATIONCODE” | grep -E ‘(Current Conditions:|F
//’ -e ‘s///’ -e ‘s/<\/b>//’ -e ‘s/
//’ -e ‘s///’ -e ‘s/<\/description>//’ | sed -e /^$/d -e ‘s/^/Now – /’
You will need the Location code for your area, these codes can be found here and once you have obtained the code for your area replace LOCATIONCODE with the correct code for your area.
For the forecast utilize the command:
curl –silent “http://xml.weather.yahoo.com/forecastrss?p=LOCATIONCODE” | sed -n ‘/Forecast:/,/^
/p’ | grep “[0-9]
” | sed ‘s/
//g’ | sed -e ‘s/\([0-9]\) /\1 F /g’ -e ‘s/\([0-9]\)$/\1 F /g’
Once again the Location code is required and if you’ve obtained the code for the previous command then you can utilize the same code again for this command.




