Scoring and Colors in mutt

August 24th, 2006  |  Published in etc

As mentioned in the .plan, I’ve been back in mutt the past few days. I’ve been playing around with scoring and color directives to see if there’s a better way to approach an inbox I acknowledge I can’t keep perfectly empty than just going with strict chronological sorting.

The net effect of all this is that the inbox index becomes less a chronological record of how mail’s arrived, and more a way to visually sort the index quickly. I think that’s something we do in real life, anyhow.

Sample screen of colored and scored mutt configSuppose you’re sitting at your desk in your cube, and a fellow lackey walks up with a folder and says “Here. Deal with this.” O.k. You’ve got a lackey, you’ve got a folder, and you know about what his rights are re: telling you to deal with something.

Then the boss walks up and plops a folder on your desk and says “Here, deal with this.” Boss trumps lackey most days.

With my coloring/scoring system, the lackey’s folder is a different color from the boss’s folder. As I’m staring at the piles of folders on my desk, I have a rough idea which ones need to be dealt with first, and it should have nothing to do with the order they arrived.

So the scheme I’ve got going now is, in the generic, like this:

  • Every single message gets spotted two points right off the bat. That’s handled with the directive score ~A 2

  • Every message that’s actually addressed to me gets another five points: score ~p +5

  • Unless it’s a press release, in which case it must pay: score "~s press.*release" -50

  • There are a few “super-people” who get 20 points just for being them.

  • There are a few “almost-super-people” who get 10 points

  • There are a few things that get a three point nudge

  • There are a few people who consistently send things I have to receive but don’t need to act on at all who get docked a few points.

Then there’s some date-based scoring:

    score ~d>3d -2

    score ~d>7d -4

    score ~d>14d -6

I haven’t really thought the math through on this because it’s the newest piece and I haven’t really seen it work. I’m thinking I’ll probably just demote 3-day-old stuff down to 0 so it hits the bottom. As I point out below, I’ve got a way to make sure it’s down but not forgotten.

Then over in the colors directives, I’ve got this:

    color index green black "~n 10-20"

    color index yellow black "~n 21-100"

    color index cyan black "~n 7-9"

That gives things scored between 7 and 100 points distinctive colors. When you sort the index by score, it creates a sort of banded effect, that goes from yellow to green to cyan.

A few more color directives create some useful effects:

This colors flagged messages red:

    color index brightred   black "~F"

This colors deleted messages blue (so they sort of fall out of visual priority):

    color index blue black ~D

And I’ve added a sort of “age alert” to messages that are getting old regardless of their score by giving them white text on a red background if they’re older than 3 days. My way of telling myself I need to either respond, delete, or do whatever I need to do because the message has been sitting for a while:

    color index white red "~d>3d" 

Good references for working this out on your own include the mutt manual pages on patterns, which tell you how to express things like “how old a message is” or “whether or not a message is deleted” and the reference on colors, which tells you how to express which elements of the index you want to color. The scoring entry won’t do much for you if you’ve already looked at my examples, except to point out that nothing can go below 0 no matter what you do to it.

Tags: , ,

Leave a Response

© Michael Hall, licensed under a Creative Commons Attribution-ShareAlike 3.0 United States license.