Will Yardley <[EMAIL PROTECTED]> said something to this effect on 07/09/2001:
> Is it possible to source different mutt config files somehow based on a shell
> script type thingie?
> 
> I guess I could have my .zshrc copy the appropriate mutt config file to
> .muttrc based on where i'm logging in from but this seems kind of silly.
> 
> basically i use the 'SSH_CLIENT' env variable to set $MY_LOCATION to 'home',
> 'work' or 'other'.  I'd like to use different .muttrc's for each location so
> that when i ssh from my home machine to my mail machine i might use different
> colors (and maybe not use gvim since it takes longer to pop up over my home
> connection).
> 
> any simpler way to do this? it doesn't appear that you can do any sort of 'if
> / then' type stuff in the .muttrc file itself...

I do this kind of thing in a shell function (I use bash, but the
concept should be similar in zsh).  I also check $SSH_CLIENT;
there is a finite, known number of addresses which I consider
"work", and everything else is "nont-work".

mutt () 
{ 
  case $SSH_CLIENT in 
    206.33.106.*)
      MUTTRC="~/.muttrc"
      ;;
    *)
      MUTTRC="~/.muttrc.home"
      ;;
  esac
  if [ -x /usr/local/bin/mutt ]; then
    if [ "x$1" = "x" ]; then
      TERM=xterm-color /usr/local/bin/mutt -y -u $MUTTRC;
    else
      TERM=xterm-color /usr/local/bin/mutt $* -u $MUTTRC;
    fi;
  else
    /usr/bin/env mutt $*;
  fi
}

-- 
It's not that perl programmers are idiots, it's that the language
rewards idiotic behavior in a way that no other language or tool
has ever done.
    -- Erik Naggum

Reply via email to