Geektool Tutorial – Custom desktop with iCal events

Custom Desktop with iCal for Geektool by Van

I could say something fun like how customizing your desktop is like interior decorating for your computer, but it’s really about making your productive life marginally easier while making onlookers in class and in the coffeeshop think you’re tech-savvy (and thus cool, because hey, coders are the new rockstars).

Getting started – A geektool “how to”

You’ll need to download and install geektool (the interface you see below, accessible from your System Preferences) and icalbuddy, which allows you to sync iCal into your geektool preferences.

  • Install note for icalbuddy - To install, just double-click on the “install.command” file in Finder (it might just say “install” if your Finder preferences are set to hide file extensions.) This script will then be run in Terminal and it will first display you the locations where icalBuddy will be installed to and then prompt you to continue.

Geektool interface

Wallpapers

These are my two most requested background images (click the image for the original source on deviantART). Part of their appeal is that warmer tones feel more natural (visually) when looking at a computer screen. When you spend many hours in front of your screen, the change to orange from blue can really make a difference! Also, if you’re on skype as much as I am connecting with family and friends, it makes the lighting from your screen appear a little more warm and natural.

sunset_skyline_wallpaper_by_neokeitaro-d5352chblur_bridge_wallpaper_by_prolite-d598z4k

Getting into the code

From System Preferences > Geektool, add a new shell (the boxes with rounded corners seen above) by dragging the shell icon to your desktop. Adjust the size and position by dragging the shell or adjusting the bottom-right corner.

  • Command: for any custom text that changes from day to day. This is where you will put code that corresponds to the date, time, mini-calendar, and iCal events. I have provided all of the codes I am using for the customization you see above. 
  • Override text: for any text that doesn’t need to change, such as your favourite quote.

The surest sign that intelligent life exists elsewhere in the universe is that it has never tried to contact us. – Bill Watterson (Calvin & Hobbes)

  • Click here to set font & color… self explanatory. If you are curious, I am using AvanteGarde LT Medium and AvanteGarde LT ExtraLight.

Date & Time

Day of the month: date +%d
Day of the week: date +%A
Month: date +%B
Time: date '+%H:%M'

Mini-Calendar

For the mini-calendar, make sure to use a mono-spaced or fixed-width font such as Courier. Otherwise, the calendar columns will be misaligned.

cal_head=`cal | head -1`; cal_tail=`cal | tail -7`; today=`date "+%e"`; echo "${cal_tail/${today}/\033[1;30m${today}\033[0m}";

List of iCal events

/usr/local/bin/icalBuddy -nc -nrd -npn -df "%A" -ps "| ~ | -- |" -eed -sd -tf "@%H:%M" -n -sed eventsToday+9 | sed -e "s/*/--/" | sed -e "s/!/!!/" | fold -s -w 88

To customize how your list of iCal events looks, please check out these resources, which tell you what each piece of code you see here actually does:

Customizing your Desktop with your Personal Calendar

Since I’ve received a lot of questions about my custom desktop (at least from fellow mac owners), I’m finally posting the info. It’s all below : )

Wallpaper : by NEOkeitaro on deviantART

Desktop customization program (for mac) : Geektool

Geektool script for 7-day advance calendar (using icalbuddy – must be downloaded and installed for this to work) :

/usr/local/bin/icalBuddy -nc -ic Work -nrd -npn -df "%A" -eed -sd -tf "@%H:%M" -n -sed eventsToday+9 | sed -e "s/*/--/" | sed -e "s/!/!!/"

(Make sure to read the installation instructions from icalbuddy provided in the ReadME file.)

Geektool script for monthly calendar with current day in black :

cal_head=`cal | head -1`; cal_tail=`cal | tail -7`; today=`date "+%e"`; echo "${cal_tail/${today}/\033[1;30m${today}\033[0m}";

Numerical day : date +%d

Day of the week : date +%A

Month : date +%B

Time : date '+%H:%M'

Font : AvantGarde LT ExtraLight