Blog Post

Mark E-mails in Mutt as Tasks in Taskwarrior

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

/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.

This entry was posted in Application and tagged , . Bookmark the permalink. Trackbacks are closed, but you can post a comment.
  • Archives