On Sat, Feb 09, 2002 at 03:09:59PM +0100, Viktor Rosenfeld wrote:
>Hi there,
>
>is it possible to have two or mailcap entries for a mime type and then
>being able to select one from mutt, when viewing the attachment?
>
>BTW, I have a mutt only mailcap file.
>
>Ciao,
>Viktor
>-- 
>Viktor Rosenfeld
>WWW: http://www.informatik.hu-berlin.de/~rosenfel/

  Well, this isn't specifically an answer to your question, but
if nobody else has the actual answer then maybe this will do.  Could
it be that the two types of mailcaps you want to select from are
"one I want when I am in X and one for when I'm just in a terminal
from a remote host?"  If so, there's a wonderful little utility
called "RunningX" that, in combination with a little mailcap juju,
will produce the effect you want (at least, it does for me).
Here's a snippet from my mailcap file:

image/gif; /usr/local/bin/qiv '%s'; test=/home/john/bin/RunningX 1> /dev/null 
2>/dev/null
image/gif; /usr/local/bin/aaview '%s'; test="test -z $REMOTEHOST"; copiousoutput
image/*; sz '%s'; test="which sz 1>/dev/null 2>/dev/null"
image/*; echo "Remote with no X or sz, punt"

  This is probably overkill, but I like having multiple failsafes handy.
:)  Basically, this is what this does with, in this example, a GIF file:

1) Checks to see if we have an X server, if so display with qiv, an X11
 graphic viewer similar to xv/ee.
2) Failing that, checks for the $REMOTEHOST variable (specifically, it's
 looking to see if it's _absent_) and if it's not there, it assumes we
 are local but not in X and uses aaview (a textmode graphics viewer) to
 display.
3) Failing that, it assumes we are remote and looks for sz to send the
 file ZModem.
4) Failing that, punt!

  RunningX is available from the usual places, or I can send it to you
if you'd like (it's 12K, 3K stripped).  A less bulletproof alternative
to "RunningX" is to use "test ! -z $DISPLAY" as the test.

-- 
------------------------------------------------------------------------
 John Buttery

       "You know, when I was in the Boy Scouts they told us the
         best way to get warm was to get naked, and get in a
        sleeping bag with someone else who was already naked."

                  "Well, maybe you'll get lucky and
                 it'll start raining sleeping bags."

                               X-Files

                                     (Web page temporarily unavailable)
------------------------------------------------------------------------

Attachment: msg24366/pgp00000.pgp
Description: PGP signature

Reply via email to