Re: sourcing different config files

2001-07-09 Thread darren chamberlain

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



Re: sourcing different config files

2001-07-08 Thread David Champion

On 2001.07.09, in [EMAIL PROTECTED],
Will Yardley [EMAIL PROTECTED] wrote:
 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

Something like

source `case $MY_LOCATION in; home) echo ..muttrc.home;; work) echo .muttrc.work;; 
esac`

Or, better,

source `echo .muttrc.${MY_LOCATION:-generic}`


(That's a muttrc directive, not a shell rc one.)

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago



Re: sourcing different config files

2001-07-08 Thread Mr. Wade

Will Yardley [EMAIL PROTECTED] asked:
 Is it possible to source different mutt config files somehow
 based on a shell script type thingie?

Using a command line argument, you can specify a different
initialization file to read instead of the ~/.muttrc file.

For example, to start Mutt using ~/.muttrc.home as the
initialization file instead of /.muttrc, you could use the
following:

mutt -F ~/.muttrc.home

Perhaps using this with some nifty scripting or aliasing will do
what you want.

-- Mr. Wade

-- 
Linux: The Choice of the GNU Generation