UNIX mail notification in the dock

Feb 21, '02 08:57:18AM

Contributed by: the_shrubber

All i wanted was a simple biff program for the dock, just a little, unobstrusive, audio/visual "new mail" signal, so that i wouldn't keep popping open my mutt window every N minutes (bad discipline). No such luck and too lazy to write something myself (and afraid of SOMEHOW managing to screw something up and lose mail). Here's what i ended up doing.

Read the rest of the article for the how-to. This hint assumes you have mutt and esound installed ... check out fink first if you don't...

[Editor's note: This tip also assumes the Dev Tools are installed and you have some knowledge of compiling UNIX software. I have not tried it myself, since I'm pretty happy with Mail.app]

Instructions:

  1. Configured mutt so that it had a very visible color for new messages in the index, bright yellow or something... this way you can see it in the Dock:
    color index brightred default "~N"
  2. Downloaded and compiled netbiff (maybe this should be a fink package)

  3. Configured netbiff to play a sound in my home directory (it's actually just a copy of Submarine.aiff from System -> Library -> Sounds). If i change my mind, i'll just copy over it without bothering to change my config:
    action "mybeep" "esdplay ${HOME}/Library/Sounds/BiffSound.aiff >& /dev/null"

    connection
    name "my mail"
    command "/homemade/bin/netbiffd"
    update "mybeep"
    folder "/mail/me"
    endconnection
  4. Made a mutt script to 1) run mutt with colours 2) launch netbiff (if not already running). The reason i chose to run it with mutt is because i couldn't figure out how to get something to run only whenever i logged into my mac (ended up creating a .command file and putting it in my login System Preferences thingy, but that gave me a Terminal window to shut, which annoyed me). I always have mutt running anyway):
    #!/bin/tcsh

    # detect if netbiff has already been launched
    set HASBIFF=`ps`
    set HASBIFF2=`echo ${HASBIFF} | grep netbiff`

    # launch netbiff if neccesary
    if ( "${HASBIFF2}" == "") then
    echo "starting netbiff"
    netbiff 2> /dev/null &
    else
    echo "biff already there"
    endif

    # set the title bar to say "mutt"
    #settitle ${HOST} mutt

    # launch mutt, passing arguments
    setenv TERM xterm-color
    mutt $*

    # set the title bar back to normal
    #cwdcmd
    Threw in a bits from a title bar hint for free ... oooh.

  5. aliased mutt to my callMutt script

  6. went away and hoped i would never be wasting my time on such trivialities again instead of doing real work
Okay, i'm embarassed to admit that this took me friggin forever to figure out... hopefully someone finds it useful, or maybe posts a tidier solution.

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020221085718945