Mark E-mails in Mutt as Tasks in Taskwarrior
January 25th, 2010 | Published in GTD, Tutorial | 3 Comments
OK, so I think most people know that I have grown quite fond of Taskwarrior for managing my Getting Things Done stuff. Many of you might also know that Mutt is my e-mail client of choice, for the past 15 years. Recently you saw a post on Planet Ubuntu by the rockstar Bryce Harrington concerning Mark emails in mutt as tasks in gtg. Well, I have had something similar, actually pretty much the same damn thing, just with a different GTD application. So without further ado, here is what you need to do in order to mark an email in mutt as a task in taskwarrior.
Setup Mutt Macro
macro index t "<pipe-message>mutt2task<enter> <save-message>+TODO<enter>"What this does is set the t key, while in the index of mutt, as a macro. The macro pipes the email message to a script I wrote that strips the header from the message and adds that as a task. The save-message part saves the email to my TODO folder.
Setup Mutt2Task Script
#!/bin/sh /usr/bin/task add +email E-mail: $(grep 'Subject' $* | awk -F: '{print $2}')
What this does is call the command task add which adds a new task. The +email tags the task, and the E-mail: $(grep ‘Subject’ $* | awk -F: ‘{print $2}’) greps the Subject line and then prints the part after Subject: from the email, therefor just giving me the subject text. Make sure you place this script somewhere in $PATH and make it executable.
Make sure you add a TODO message folder in your mutt configuration so you can see the TODO messages.





January 26th, 2010 at 01:31:43 (#)
Really nice hint. I am actually using “Remember the Milk” for tracking my tasks, so I’ll have a look to modify it to use the rmilk api.
January 28th, 2010 at 06:30:39 (#)
[...] Mark E-mails in Mutt as Tasks in Taskwarrior [...]
May 28th, 2010 at 21:38:04 (#)
Thanks a bunch Richard, as always this has been very helpful