Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've configured .mailcap for mutt to handle mimetypes of attachments individually, with different 'viewers' over the years which works well, however mailcap can handle only one application per type. I'd like to choose from a set of applications and if possible have a default one.

I suspect that this feature is outside of mailcap's scope. Is there any generic file-handler i could pass data to handle certain types on request and having a default type. (My first thought would be gnome-open. This is kind of like 'open file' where right click let's one choose an application, but double click uses the default app.) The tricky part here is that most of mutt's output is into stdout while sometimes the output is to the window manager.

Here is an example mailcap:

text/html; elinks -dump -dump-charset utf-8 -default-mime-type text/htm %s; copiousoutput
image/jpeg; jp2a %s; copiousoutput

Now while elinks is fine most of the time to render html to stdout, sometimes i'd like to use firefox for html. Same for jp2a, it's convenient to have ascii by default but sometimes i'd like to use display to show the jpeg graphically.

share|improve this question
    
Why do you want multiple? Is it because you want different thing to happen in X and not in X? –  user7385 Jun 19 '13 at 20:04
    
Yes, or use different browsers to render html for example. I've been using mutt with X a lot, it just breaks once you have only terminal available. –  count0 Jun 19 '13 at 20:06
    
Why don't you simply write a script that will test if you have DISPLAY set, and based on this run either console or graphical browser? –  user7385 Jun 20 '13 at 4:09
    
I'd really like to choose between applications. A script would solve the terminal vs. wm use-case, and it's probably a good start. I'd have to pass and handle the mime types in the script myself to handle choices. –  count0 Jun 20 '13 at 17:49
    
Check program urlview. It's in apt repository in debian/ubuntu, and I guess in other distributions it is available too. –  user7385 Jun 20 '13 at 18:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.