Tag Archives: Widgets

Tutorial

Geek Tools...

I've been tinkering around a little bit with GeekTools, which is a Mac utility that allows you to customise your desktop, to try and customise my desktop a little bit to integrate some dynamic components.  I've seen a few interesting desktop arrangements on LifeHacker lately and decided to see if I could nerd it up a little more too with time apps, weather, and basic connection status.

April '11 Geektool Desktop

Combining this with a nerdy wallpaper with a Star Wars theme I've managed to pimp my desktop suitably and for a first attempt I'm pretty happy with it.

Desktop

The time, date, etc are all pretty easy to set up and they can be taken from this link.  However I struggled for quite a while to get the weather app setup to allow real time updating of the weather in my area as Yahoo has changed the way that they create the links and therefore lots of the tutorials that I've found don't quite work anymore because they're based on the old Yahoo Weather codes.

To help future non-US guys set up their own Geek Tools I've listed out the Syntax for a couple of my widgets that gives the Weather in Stockport, these would be easily customised for any other UK city by simply determining the code for your city using the following link.

To create the weather image, you need to add two widgets in Geek Tools, one is an image widget that physically shows the picture, the other one is a shell element that is used to farm the image from the Yahoo site.  The URL that is in red in the syntax below would need to be swapped out for a URL that reflects wherever your location is, and this is simply done by finding your Yahoo Weather site for your city and then copying and pasting this URL to overwrite the red text in the link below.

[Image]
file://localhost/tmp/weather1.png

[Shell]
curl --silent "http://uk.weather.yahoo.com/england/greater-manchester/stockport-36177/?unit=c" | grep "current-weather" | sed "s/.*background\:url(\'.*\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\

 

The next step is to then get the textual description that goes next to the icon, this is a little trickier as all of the tutorials that I found made use of the RSS feed utility from Yahoo that doesn't appear to exist any longer.  You'll have to work out your city code using this website and then replace the text in blue in the shell element script that you'll create below.

 

[Shell]
curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX0140&u=c" | grep -E '(Current Conditions:|C<BR)' | tail -n1 | sed -e 's/<BR \/>//' -e 's/ C$/˚C/'

 

Sometimes it can take a few minutes for this to refresh and update onto your desktop, but I found that these were the only scripts that I could get to work and I'm going to stop tinkering anymore with my desktop for a while before I kill it.