Friday, February 26, 2010

Linking notes and email messages

A few days ago, I've cobbled together a note-taking solution for my email messages. It's very unixy, consisting of a fair number of different parts working together: Claws Mail with the Python plugin and two of the shipped example scripts on the one side, Tomboy with the Claws Mail addin and the Reminder addin on the other side.

Starting with a message selection in Claws Mail,

a click on the "Create Tomboy Note" menu item of the Python example script results in this dialog popping up (I know that this dialog is ultra-ugly, but hey, it's a quick&dirty easy-code example script, nothing more)

which in turn creates this Tomboy note

The Tomboy reminder plugin will take care to remind me about this next monday by raising the note.

To make the round-trip complete, there's a second example script that raises all Tomboy notes that link to a selected message.

Okay, admittedly not the end-user friendliest setup, but it suits my needs pretty well. And it shows the benefits of scripting language interfaces for glueing components together -- it didn't take long to write the scripts to make this work, even though the plugins and addins have not especially been designed for it.

Monday, January 18, 2010

The Tomboy and the Git

Tomboy's taming of the beast turned out to be a very useful feature for my daily note keeping. But emails are not the only pieces of information that I often find associated with tasks. Another recurring source that I want to reference are commits in source code management systems. So, if Tomboy can play nicely with my MUA, why shouldn't it play nicely with my source code repository browser as well?

Unfortunately, there's no drag-and-drop target for git repository viewers defined. Most viewers just don't let you drag from the commit list into another application. So, I tried to contact the guys from gitk, giggle, and gitg in the hope to define such a dnd target. The guys from gitg seemed to be the only ones interested in that functionality (good thing that gitg is currently my favorite browser anyways), and it didn't take long until they added the required features.

With that in place, it was easy to write a Tomboy addin that handles dropping of git references into a note analogous to dropping email messages: By creating a link with a nice icon and a meaningful text which when clicked opens the git repository viewer and selects the respective commit.

I like these little helpers. They have a good work/gain ratio.

Sunday, January 17, 2010

Extending and Automating Claws Mail - the sneaky way

The recent release of Claws Mail 3.7.4 has also seen a much more powerful version of the Python plugin. It is now possible to write scripts that are executed automatically on startup, shutdown, or opening of a compose window. It's also now possible to write scripts that work on an already opened compose window. The user interface got better as well (e.g. it's now possible to trigger scripts via toolbar buttons).

However, what the latest release still lacks, is documentation and examples. After all, features that are not documented don't exist. This is supposed to get better in the next release. I've started adding a few example scripts to the source distribution that show possible solutions to questions that have been raised on the user's mailing list lately. Most of these should already work with the released version of the plugin, with the exception of the startup script that show's how to add new menu items for custom actions into the main window (the examples being a menu item to mark a thread as read, and to add a menu item to create and show the Python plugin's API documentation on-the-fly - isn't introspection cool?).

Anyways, if anybody scripted something cool with the plugin, please consider sending the (well commented) script to me. I'd be happy to consider it for inclusion in the distributed examples.