Display iCal Events and a To Do list on your desktop

If you are looking for more Geektool scripts then check out the Mac OS X Tips Geeklets site. It has loads of user-contributed Geeklets all in one place for you to download.

Recently I have been trying out different ways to display the current day's iCal events and to do items on my desktop. I wanted a way of quickly checking what I need to do that day without having to open iCal, Dashboard or any other application, and eventually I found a method I was happy with. The screenshot below shows how I have mine displayed, but it's pretty easy to customise it to your own needs. Here are the steps if you want to do it yourself.

1. Get GeekTool and iCalBuddy
To set this up you need to download two (free) applications. The first is GeekTool, a preference pane that allows you to display files, images and shell scripts on the Desktop. The second is iCalBuddy, a command line utility that lets you access events and to do items without having to open iCal.

Download GeekTool from here and install it by double-clicking on the preference pane. You can now access it by going to System Preferences and looking in the bottom row.

Download iCalBuddy from here and double-click it to unzip the folder. Then double-click the install.command file, and enter your administrator password when the window appears. You can then close the window.

2. Set up GeekTool
Once you click on the GeekTool section in System Preferences, you will see a window with three different icons. Drag the one called “Shell” to a position on the desktop behind the window. A black “Properties” inspector window will appear, where you can enter the settings for this geeklet. The bits you need to change are the Command and Style sections. In the command box, paste date and click the button below to set the font and colour to something that complements your background and make it a bit bigger. If you look on your desktop now, the date should be written in the top left. You can click and drag this around to where you want it, or you can type in the position in the bottom right of the GeekTool window. As you can see, the time only updates every 10 seconds. You can change this in the Refresh box above the Command box.

3. Change the appearance
If you have a dark Desktop background, you may find that you can't see the date. By default the date appears in an ugly plain fixed width font with a black text colour. To make this more visually appealing, click on the "Colors and Font" tab and adjust the settings. You can see my settings in the screenshot below. Obviously lighter text colours work better with darker desktop backgrounds and vice versa.

Geeklet Style Properties

4. Format the date
The Shell option on GeekTool works just like the Terminal. If you type date into the Terminal and press enter, you should get exactly the same thing back as shown by GeekTool. Conveniently, the date Terminal command has a number of options to change the style of the date. As you can see, the default setting includes the time, time zone and year that I don't really want. The command for my preferred date format is date '+%a %e %B' which gives something like Wed 18 February. Apple has a list of formatting options here you can use to change it to whatever you want. You need to put a + at the start, followed by the symbols for the bits you want. You can but punctuation like commas between the symbols, and the whole thing has to be enclosed in single quotes.

5. Add today's iCal events
This is where the iCalBuddy application comes in. Create a new geeklet by dragging the “shell” icon onto the desktop as before. In the Command box type /usr/local/bin/icalBuddy eventsToday. This should bring up a list of today's events on the desktop. There are loads of customisation options for iCalBuddy, so I won't go through them all, but I'll show you mine. The command I use is:
/usr/local/bin/icalBuddy -nc eventsToday | sed -e "s/*/--/" | sed -e "s/!/!!/"
The -nc part removes the calendar name in brackets because all my events are in the same calendar. The sed -e "s/*/--/" part changes the * at the start of each event to a -- because I think it looks better. The "sed" and "awk" commands are really useful for customising the output, but I won't go into much detail here. Just do a Google search for a tutorial if you want more information. For the different iCalBuddy customisation options, check out the man page.

One customization to note is the "eventsToday+NUM" option. Replacing eventsToday with eventsToday+3, for example, will display the events for the next three days in separate sections titled by the date.

6. Add to do items
To do items work in pretty much the same way as the iCal events. The command to use is /usr/local/bin/icalBuddy uncompletedTasks. Similar to before, the command I use is:
/usr/local/bin/icalBuddy -nc uncompletedTasks | sed -e "s/*/--/" | sed -e "s/!/!!/"
The only difference to the modifications before is that I also double up the ! that appears for overdue uncompleted tasks.

7. Add some titles
If you just want GeekTool to display some text, the easiest way to do it is to use the echo command. Just create a new entry and use the command echo To Do List to make it display "To Do List" on the Desktop.

8. Set the Refresh rate
The next thing to do is to set a suitable refresh rate for each item. It is worth noting that these command take very little system resources, and having them all update every 10 seconds produces absolutely no decrease in performance whatsoever that I've noticed. However, in principle you should only really make them refresh as much as you need them too. I've set all mine to update once an hour (3600). This means that the worst case scenario is that the information is wrong for up to an hour between midnight and 1am each night. If you like having the time displayed in the date command, you probably want that to update every second.

8. Make it pretty
Finally, you just have to change the font and colour of each entry and position them somewhere you want on the Desktop. I went for the far left as it's a place guaranteed not to get covered up by icons.

9. Go crazy
There are hundreds of things you can do with GeekTool, and it's definitely worth trying them out and seeing what you like. In the end, I only kept the iCal events and to do list, but you may like having constant updates of your uptime, running processes, CPU use, local weather maps, IP address, current iTunes track etc. Check out the Mac OS X Tips Geeklets site for more.

blog comments powered by Disqus