What’s on my desktop (clever MacOS scripts)

I’ve been playing around on and off with Geektool for a little while now. Knew I could make something useful, but it has taken a while to get all the combinations to something I’m happy with. The screenshot above is from my Macbook, with Adium running on the right for instant messaging and a set of Geektool scripts on the left for time/date/weather. This is surprisingly easy to achieve, so published here are the results of my Googling on the subject so others can try too.
The first job is to install Geektool into your system preferences. To do this go here, download and install. Geektool will allow you to drop files and images onto your desktop as well, but what I’m really interested in are the scripts. To add these drag a new Shell object on to your desktop and enter the code. Below is a list of the things I’m currently using for you to copy and paste. The stuff in italics is what you are after.
Time: date ‘+%I:%M %p’
Day: date +%A
Date: date +%d
Calendar: cal
Weather: curl –silent “http://xml.weather.yahoo.com/forecastrss?p=UKXX0138&u=c” | grep -E ‘(Current Conditions:|C<BR)’ | sed -e ‘s/Current Conditions://’ -e ‘s/<br />//’ -e ‘s/<b>//’ -e ‘s/</b>//’ -e ‘s/<BR />//’ -e ‘s///’ -e ‘s/</description>//’
Sunrise: curl –silent http://weather.yahoo.com/england/hampshire/west-end-27956545/ | perl -pe ‘s/n//g’ | perl -pe ‘s/.*Sunrise:</dt><dd>/Sunrise: /m’ | perl -pe ‘s/</dd>.*//m’
Sunset: curl –silent http://weather.yahoo.com/england/hampshire/west-end-27956545/ | perl -pe ‘s/n//g’ | perl -pe ‘s/.*Sunset:</dt><dd>/Sunset: /m’ | perl -pe ‘s/</dd>.*//m’
For the weather and sunrise/sunset examples here you need to go to the Yahoo weather site and change the value highlighted in red for the one relevant to your own location.
Once you’ve got the elements you want on to the desktop it’s just a case of being a bit creative with colours, sizes and positions. The colour scheme designer here is great to help out with that, and in the case of the laptop desktop pictured above I’ve been using century gothic font.
There’s a huge amount more you can do with Geektool and a bit of scripting know how, this is how I’ve started. Feel free to add other ideas, and I’ll update as I discover new scripts.
