hasseg.org

My Custom GeekTool 2 Build with Support for ANSI Colors, UTF-8 and Different Writing Directions

Filed under Mac

GeekTool-hasseg-logos 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.

Update (Sep 6, 09): 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.

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:

geektool-hasseg.org-build

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 :(

Download link

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:

  1. Extract the files from the zip archive by double-clicking on it in Finder
  2. Double-click on the GeekTool.prefPane file icon in Finder to install it
  3. 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."
  4. 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.

Added Features

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:

geektool-hasseg.org-build-desktop-example

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:

geektool-hasseg.org-build-ansicolors

You can specify different colors for each GeekTool entry you have.

UTF-8 Support

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:

geektool-hasseg.org-build-textdirection

11 Comments

Kirby July 14, 2009 at 1:34 AM

I keep just getting an error that says “Could not load GeekTool preference pane.” Is this another one of those things where it’s only compatible with OS X 10.5 but you decided to let us download and bang our heads against the wall trying to figure it out rather than just saying so?

Hint: Best to always include important system requirements on on an app download page. Your users will thank you for it.

Kirby July 14, 2009 at 1:39 AM

Your GeekTool Uninstaller app doesn’t work, either.

Ali Rantakari July 14, 2009 at 1:53 AM

Hi Kirby,

This build does indeed require Leopard, and it says so right next to the download link.

The uninstaller is unchanged from the original 2.1.2 code that I started with and I don’t think any of my additions should change the way it would work. I believe you when you say it doesn’t work, though, so I will try to take a look at that when I have time.

ical buddy : Test Site October 27, 2009 at 12:31 PM

[…] download the iCalBuddy GeekTool 2.2.1 unofficial hasseg build, click here. There is also more information about the features you may find useful. Note: There are two […]

iCalBuddy : Test Site October 30, 2009 at 11:51 PM

[…] download the iCalBuddy GeekTool 2.2.1 unofficial hasseg build, click here. There is also more information about the features you may find useful. Note: There are two […]

Daily Review #19 | The Queue Blog November 7, 2009 at 5:49 AM

[…] great because I have to hit F12. I ended up going with iCalBuddy and GeekTool (hasseg.org’s custom build of GeekTool), and a bunch of tweaking, but I’m happy, I have a 7 day agenda on my […]

GeekTool: Turn Your Mac’s Desktop Into An Information Center – Make Tech Easier March 9, 2010 at 3:01 PM

[…] you are keen to place your iCal event in your desktop, you might want to install the custom build of GeekTool by icalBuddy […]

Turn Your Mac’s Desktop Into An Information Center | VNAMEDIA - Bring the World to your life! March 19, 2010 at 1:30 PM

[…] you are keen to place your iCal event in your desktop, you might want to install the custom build of GeekTool by icalBuddy […]

GeekTool + GeekTweet | Tady je Vykookovo April 10, 2010 at 12:18 AM

[…] Napsat skriptík v Pythonu nebyl problém, horší bylo, že GeekTool jaksi neumí unicode, našt?stí existuje jakási upravená verze, která ob?as b?hem nastavování sletí, ale jinak funguje pom?rn? dob?e. Tu najdete zde. […]

iChat BuddyList auf dem Desktop mit GeekTool / NerdTool July 14, 2010 at 11:36 PM

[…] wird der Name je nach Status mit ANSI-Farben eingefärbt, so dass man in NerdTool bzw. dem GeekTool 2 ANSI-Color-Build schönere Farben einstellen kann. Für Farbe und Umlaute müssen die Optionen so wie im oberen […]

nick January 2, 2011 at 2:21 PM

I have it all set up and everything is working. The only thing remaining is actually programming in ANSI codes. But I cant figure out how: echo -e ‘\E[33;44m’“yellow text on blue background”; tput sgr0 doesnt work!

Categories