Posted on July 8, 2009
Filed under Mac
A year ago I released version 1.0.8 of my icalBuddy command-line application that I initially wrote as a way to get nicely formatted lists of my events and tasks from the OS X calendar store on top of my desktop background picture using GeekTool. This particular version was notable in my mind because it introduced initial support for formatting the output via ANSI escape sequences. The initial formatting was static (that is, you couldn’t change it) and very simple (it only made the titles bold), but since then I’ve implemented all kinds of different customization options that can be used to specify how the output should be colored and otherwise formatted. The only problem was that GeekTool didn’t support ANSI escape sequences, which meant that instead of the nicely formatted output I wanted GeekTool would display a bunch of gibberish if I used the -f icalBuddy argument.
There was nothing on the horizon about any further additions to GeekTool (or any similar programs) that would provide the features I wanted (although version 3 of GeekTool seems to be in the making, and there’s also the GPL’d NerdTool project which aims to implement a clone of v2 with some changes and fixes), but luckily Yann Bizeul, the author of GeekTool, had released the source code to it, which enabled me to put this feature (and a few others) in. As you can see from the screenshot below, I also took the liberty to rearrange the GUI a bit:
I’ve been running this custom build for a few months now without any problems so I feel reasonably confident about releasing it. No open-source license has been specified for GeekTool 2.1.2 so I unfortunately won’t be releasing the source code for the changes I made. Sorry :(
First the most important part — here’s the download link:
GeekTool-2.2.1-unofficial-hasseg.org-build.zip (Latest version. Requires Leopard (Mac OS 10.5+)) (Sep 6, 2009: Recompiled the preference pane as 32/64-bit binary with support for garbage collection so that it would not force System Preferences to restart on Snow Leopard.)
GeekTool-2.2.0-unofficial-hasseg.org-build.zip (Requires Leopard. Based on source code from version 2.1.2)
Disclaimer: I will most probably *not* fix bugs in this version or develop it further in any way. This is simply a temporary solution until the next official version of GeekTool comes around (if it includes these features, which I don’t know if it does), or someone else releases something similar.
In order to install it, do the following:
- Extract the files from the zip archive by double-clicking on it in Finder
- Double-click on the GeekTool.prefPane file icon in Finder to install it
- If you already had GeekTool installed, System Preferences will ask if you want to replace it. Select “Replace”, quit and restart System Preferences and open the GeekTool preference pane, verifying that the version label now says “unofficial hasseg.org build.”
- Unselect the “Enable GeekTool” checkbox in order to kill the old version’s background process, and then select it again in order to run the updated one.
ANSI Escape Sequence Support
As said, this version includes support for ANSI escape sequences, including all the supported foreground and background colors (each of which you can change yourself on an entry-by-entry basis in GeekTool’s preferences), intensity (bolding) and underlining (both single and double). Here’s an example of how my (customized) icalBuddy output looks in my GeekTool setup:
In order to learn how to customize icalBuddy’s ANSI-formatted output, please refer to the icalBuddyConfig man page. Also remember that you need to use the -f (or –formatOutput) argument to get formatted output in the first place.
Here’s what the new little preferences window that you can use to customize the actual colors used for displaying ANSI escape colors looks like:
You can specify different colors for each GeekTool entry you have.
This version now supports UTF-8, which means that unicode characters (umlauts, arabic, hebrew etc.) will display correctly (version 2 only supported ASCII).
Text Writing Direction Setting
I had received word from one particular user of icalBuddy from a country where the language is written from right to left (arabic, to be precise,) who had issues with the bullet point sometimes shifting to the right side of the row instead of staying at the left. This was due to the OS X text layout algorithm trying to figure out if it should print characters in a string onto the screen from right to left or from left to right and sometimes failing due to mixtures of latin and arabic characters being on the same line. Now problems such as this can be fixed by explicitly specifying the text layout direction: