My Desktop
January 22nd
I recently realised that I haven’t gone into any detail about my work environment. For today, I thought I’d start with my desktop. First things first, the wallpaper is from a picture posted up on Twitter recently by Bryan Lee O’Malley — the author of the wonderful Scott Pilgrim series, soon to be a movie by the talented Edgar Wright (director of Spaced / Shaun Of The Dead).
But recently I’ve been getting comments about the “crazy text in the top left corner” of any screen-shots I show people, so I thought I’d post up a bit of a tutorial for the application that makes this all possible — GeekTool. What it does is run scripts and commands that you would use in Terminal and display the output on your desktop.
GeekTool is quite simple to use. For now we will just be messing with ‘Image’ Geeklets, just drag one into position on your desktop and you will see the ‘Properties’ window. There are three important things here: Command, Refresh, and Style. Command is where you will enter the scripts below, Refresh is how often you want the output to refresh (I find 10s works well for most cases), and the button below Style — ‘Click here to set font & color.’ — opens up the default Font style window of OS X (which you should already be accustomed to).
The various scripts I’ve gathered together below have been collected from tutorials all over the web, I hope you find them as useful as I did.
Date
We’ll start from the left and move our way across to the right. First up we have the date, to display this we use date +%d. Similarly, the month and day are generated using date +%b | tr ‘[a-z]’ ‘[A-Z]’ and date +%a | tr ‘[a-z]’ ‘[A-Z]’ respectively.
Dividers
The dividers are very simple, just echo '|'.
Time
The time is achieved in much the same was as the date was: date +%R. If you’re not comfortable with 24 hour time then you will want to use date +%I:%M.
Weather
The weather was a tricky one. I went through various scripts using both Lynx and cURL, Yahoo Weather and Weather Underground. The one that I found that worked best was:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=YOURCITYID&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1
The problem with using Yahoo Weather is that it’s recently been changed to use a different set of parameters, and although both new and old will work for American cities the same does not seem to be true for the rest of the world. Luckily AOL uses the same naming conventions. So if you visit AOL Weather, and find your city, you can get the ID from the end of the URL. In my case it was ‘UKXX0045’. You will then need to use that to replace YOURCITYID in the code above.
Music
This is the bar with the Kanji (because I was listening to Yura Yura Teikoku at the time) that is underneath the rest of the information. This doesn’t use GeekTool at all, but rather Bowtie. Bowtie is supposed to sync with your Last.fm page, flash Growl notifications on new songs, allow custom key combinations to control music, and look pretty on your desktop (using an HTML and JavaScript theming system). In truth it does all of these things quite poorly, and I’ve often found it will simply stop syncing with no warning, but it is still only in Beta.
Hopefully you found these scripts of some use. If you’re looking for more then I would recommend you Google “geektool scripts”, or visit this over 70 page thread on MacRumors.






