Saturday, January 6, 2007

A cute desktop clock for OS X

One of the reasons I love OS X so much is that it makes it so easy to do cool things with Unix. In today's post I'll show how I made a desktop clock using GeekTool and the date command. GeekTool is an OS X application that will render text files, images and shell command output into the desktop. Its website isn't really updated a lot, but it still works, and if it doesn't, its source is out there. I guess it got mostly superseded by the widgets of the Dashboard, but it renders into the desktop, which Dashboard won't do without some hacks. (Although that might change next week if/when Leopard comes out :-) ) I also used this great free font I found, Atomic Clock Radio. To set it up, I created a rounded background (using The Gimp of course), and told GeekTool to put that on the right side of my screen with a pleasing opacity (in the style tab).
Then I added the output of the command date "+%H%n--%n%M", updating every 20 seconds, in another item and told it to render with the Atomic Clock Radio font. That command renders a 24h clock with embedded newlines. The dashes looked most pleasing. Experiment, it's easy.
That's all there is to it. Simple tools with big impact, that's how I like my Unix ;-) You can get the background image I used here. It's rounded on all sides, so you can choose where you put your clock.

No comments: