GTD with Mutt
X-Labels are nice to add comments to mails in your inbox. If you keep track of your TODO stuff in a GTD-way ("Getting things done") X-Labels can be even more useful. Here's a little script I'm using to comfortably label and save incoming mails with Mutt.
You can get the whole package here: http://footils.org/pkg/mutt-gtd.tgz
Installation
If you downloaded the tarfile you can follow these instructions:
- Put "editlabel" somewhere into your path and make it executable ("chmod +x /path/to/editlabel")
- Put "label-wide" and "label-narrow" into ~/.mutt/ (or adapt the paths)
- add muttrc-gtd into your ~/.muttrc (or source it from there)
editlabel is actually a dumbed-down version of the Mutt X-Labeller written by Alberto Bertogli. I didn't want to insert prefabricated labels, but free-form labels, so I just removed all the stuff dealing with that.
While I was at it, I also removed the menu to specify actions like "clean" from it. To delete an X-Label, just insert a label wih just "x". (Of course if your NextAction for something is "x", you're fsck'd.)
The labeller then was married with the GTD/Mutt ideas of koweycode: Two keyboard macros, Alt-a and Alt-w (rsp. Esc-a or Esc-w) were added to edit a label and then save to the ACTION- rsp. WAITFOR-folder in your maildir.
There still seems to be a bug in this somewhere (or a bug in Mutt) because somehow the wrong message is selected for saving after a label was edited. I tried both with the <next-undeleted>-command after syncing, and without it, but on both versions it sometimes works correctly, and sometimes it doesn't.
Using a Config-trick from the Mutt-Wiki I also added a mapping to expand and (almost) hide the X-Label in the index view. As default it is mapped to <esc>x (Alt-x).
Here are the files included in the tarfile:
editlabel:
#!/bin/bash
# $1 is the filename
FNAME="$1"
NFNAME="/tmp/editlabels-`basename "$1"`.$$"
function asklabel() {
read -e -p "Label ('x' to del) [$2]: " $1
CVAL=${!1}
}
ACT=`formail -c -X X-Label < "$FNAME"`
asklabel LNAME "`echo $ACT | sed -e 's/^X-Label: //'`"
if [ "$LNAME" ]; then
if [ "$LNAME" == "x" ]; then
# label "x" means remove label:
formail -I "X-Label:" < "$FNAME" > "$NFNAME"
else
# set label to new label:
NEW="X-Label: $LNAME"
formail -I "$NEW" < "$FNAME" > "$NFNAME"
fi
fi
# if we created a new file, step over the old one
if [ -f "$NFNAME" ]; then
mv "$NFNAME" "$FNAME"
fi
muttrc-gtd:
# put this at the end of your muttrc:
# store editor to be able to restore it after label editing:
set my_default_editor=$editor
# labels, inspired by: http://auriga.wearlab.de/~alb/other/mutt-labels/
macro index,pager y "<enter-command>set editor=\"editlabel\"<enter>\
<edit><sync-mailbox><next-undeleted>\
<enter-command>set editor=\"$my_default_editor\"<enter>" "Add/remove label"
# write label, save to action file:
macro index,pager <esc>a "<enter-command>set editor=\"editlabel\"<enter>\
<edit><sync-mailbox><next-undeleted>\
<enter-command>set editor=\"$my_default_editor\"<enter><save-message>=ACTION" "Add label and save to ACTION"
# write label, save to waitfor file:
macro index,pager <esc>w "<enter-command>set editor=\"editlabel\"<enter>\
<edit><sync-mailbox><next-undeleted>\
<enter-command>set editor=\"$my_default_editor\"<enter><save-message>=WAITFOR" "Add label and save to WAITFOR"
# save message that need a response to the RESPOND mbox:
macro index,pager <esc>q "<save-message>=RESPOND" "Save message to RESPOND"
macro index,pager <esc>s "<save-message>=inbox-archive" "Save message to inbox-archive"
# start with a narrow label-display (this also maps <esc>x to toggle label width)
set my_default_index_format="%4C %Z %{%b %d} %-15.15F (%4l) [%?Y?%-3.3y&---?] %s"
set my_label_index_format="%4C %Z %{%b %d} %-15.15F (%4l) [%?Y?%-45.45y&---------------------------------------------?] %s"
set index_format=$my_default_index_format
source ~/.mutt/label-narrow
label-wide:
set index_format="$my_label_index_format" macro index <esc>x "<enter-command>source ~/.mutt/label-narrow<enter>" "Switch Label Width"
label-narrow:
set index_format="$my_default_index_format" macro index <esc>x "<enter-command>source ~/.mutt/label-wide<enter>" "Switch Label Width"
comments
- kowey wrote:
Great! (I haven't actually tried it, but I like it in principle) - kowey wrote:
I've finally given it a try moving to a new machine. Works like a charm. Especially pleased about not having to re-save the message to keep the label. Only downside wrt the on-board label editor is that I can't see the message as I am labeling it. But no big deal. Good work! Btw, Vincent Danen's later post looks suspiciously similar to yours, without any credit given... in case you cared about that kind of thing... maybe it's just a lucky coincidence, but I'm doubtful ;-) - kowey wrote:
One minor flaw in your muttrc sample: it does not account for people whose mutts are configured to confirm before purging messages. This gets annoying because it manifests in your editor not being reset after you invoke edit-label. To fix it, throw in an extra "enter" command after sync-mailbox. - fbar wrote:
Hi kowey, thanks for your comments. That techrepublic post indeed looks similar - especially with the =RESPOND saving ;) - but I don't really mind. I'm more proud of the index-format changing I managed to achieve. Oh, and actually I now use a slightly different approach: I now keep all my GTD stuff in a single mailbox =GTD. The various sections are seperated by different label tags: "A some action", "W I'm waiting" and "S maybe someday". Then I use limiting in Mutt to show only the messages, starting with A, W or S using: macro index,pager <esc>a "<limit>~y \^[aA]<enter>" and so on. This is faster than opening separate mailboxes, and faster is better. ;) --fbar - SKK wrote:
Just wanted to say that I like what you have done and i have implemented it i also used your comment above "Oh, and actually I now use a slightly different approach: I now keep all my GTD stuff in a single mailbox =GTD. ...." - i use 1 2 3 4 5 as the labels based on http://sifter.org/~simon/journal/20080425.2.html too. Thanks for the good work Have in mind that it does not work with older versions of mutt due to my_default_editor being an "unknown variable" and possible for other reasons too - i had to install my own version of latest mutt to get it to work (i use a shared machnie and have no root access). - motsitteE wrote:
hmm interesting site. I like to utilize my precious decade A JOKE! ) What do the letters D.N.A. stand for? National Dyslexics Association. - Extenze wrote:
Preved medved <a href="http://www.kaboodle.com/extagen">extagen</a> - EZWilliam wrote:
oh yeah, one more thing I hope you like my kind council Sorry, for off top, i wanna tell one joke) What happens when a ghost haunts a theater? The actors get stage fright. - sosoft wrote:
Куплю Windows Куплю Office -2003/XP/Vista sosoft@bk.ru и другой ЛИЦЕНЗИОННЫЙ софт пишите на е-мейл sosoft@bk.ru - sosoft wrote:
Куплю Windows Куплю Windows -2003/XP/Vista sosoft@bk.ru и другое ЛИЦЕНЗИОННОЕ ПО Microsoft пишите на е-мейл sosoft@bk.ru - FZRichard wrote:
Hi <a href= http://ciallis-us.info/maxwilly/index.html >maxwilly</a> What type of questions should I ask my doctor about so i can get cialis? Plus how much is the cialis one a day pill, because the cialis regular pill is too much. thanks Bye !! - Phepheery wrote:
car insurance idaho falls massachusetts car insurance companies car insurance wichita falls car insurance for young men Look at great <a href=http://car-insurance-hirx.netfirms.com/all-car-insurance-kingston-ontario.html>all car insurance kingston ontario</a> cheap car insurance for new drivers mass car insurance laws london low car insurance rates used car insurance rates purchase extra rental car insurance car insurance catergories car insurance new haven car insurance company in georgia car insurance park hills online cheapest car insurance in uk half moon bay car insurance consumer reports car insurance footman james classic car insurance car insurance comprehensive coverage line car insurance quote car insurance manchester new hampshire discount car insurance car insurance quotes online ontario - freehost wrote:
Hi all, I think this information can be useful for you. If you plan to get your website, here is one good free web hosting provider to choose - 000webhost.com They provide hosting absolutely free, there is no catch. You get 1500 MB of disk space and 100 GB bandwidth. They also have cPanel control panel which is amazing and easy to use website builder. Moreover, there is no any kind of advertising on your pages. You can http://free-host.orgfree.com - Free Web Hosting. - hooliostark wrote:
asia dispensary - <a href=http://tvitujopqr.fizwig.com/asia-dispensary.html>asia dispensary</a> - guandowmeneda wrote:
Good evening <a href= http://vigra-health.info/viagera/site_map.html >viagraa </a> :) It will help you grow, but it could also have other side effects. Bye !! - guandowmeneda wrote:
Good <a href= http://vigra-health.info/viagras/index.html >buy vigra </a> :) Some side effects do not require a physician’s attention, although they should be reported to the physician to help ensure accurate dosing. Side effects such as depression, insomnia, numbness, tingling, nervousness, dizziness, anxiety, dry mouth, sore throat, runny nose, infection, headache, nausea, decrease in appetite, and diarrhea are quite common while taking Provigil or Modalert/Generic Modafinil. Pa!!! - Tartiazoriads wrote:
It's just about sport agv sport gloves united motors sport bike men wet sport shorts sport fencing associations/online fishing loma point sport - untomoannor wrote:
Hi all! <a href= http://rxcialies.info/cilliss/site_map.html >cialis </a> :) Swallow the tablet whole with a glass of water it can be taken with or without food also. Goodluck!!! - Intippifons wrote:
Hi all! <a href= http://vigralist.info/vigra/site_map.html >viara </a> :) It really depends on how you understand "generic." Although in pharmacology, we often prescribe drugs in its generic form which is also the active ingredient of the drug. For the brand Levitra's case, it's active ingredient is Vardenafil, hence it is also its generic name. Pa!!! - Suxuddyskenny wrote:
Hi all! <a href= http://vigra-erectile.info/vaiagra/index.html >viaggra </a> :) For example, I tried googling the term "Vardenafil" and went to see this site " " via the ad which says "buy generic levitra." Goodluck!!! - IvanSidorovkar wrote:
Hello! I charged in one secondary secondary village, in Stavropol Territory. Dont skilled in as there in greater cities, and at us in all sketch, so is felt and to buy really difficultly something, except for kerosene and matches, and with masterpiece awfully scarcely :( Here so I masterpiece in the next stingy village as the tractor worker + in colloid excavator worker (at us one tractor and one dredge, a facilities stingy, ergo I with all contend with), suitably and problems with machines I should interpret all. And here recently, the caterpillar has shivered on a dredge, all our masters pull someone's leg told, that to adlawful is not a subject. And with works at us by no means, and furthermore with bones in some measures for a dredge. I to the heads, they deceive told, a quay of funds we shall act on lanky in some measure and where to infer search itself, the column is your problems. And me that? exertion to squander it would not be choice, began to search, and here virtuous the daughter has arrived with the guy, and it at it there a computer is (on it I by the way now and I forgive) and here it to me has advised to buy lanky icipation in the Internet inform on <a href=http://www.magzap.ru/>in it </a>. But in some way I to these do not conviction all the Internet to magnates, whether and furthermore if what to retort :( me impel, gratify, it is exigent to hand over the Internet-snitch ons or there is quiet what production, who can desire influence, where it is preferably to buy? entirely much I hanker to approve of impartial responses/advice so to say uncluttered people, the in spite of consumers, as I.





