Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I love lynx. I love browsing without tabs. Call me a luddite, but I only use a modern browser if I have to. Which is about twice a day, for a few minutes at most.

There's one thing I really really hate about lynx, though. It's not immediately apparent how to customize lynx's behavior when it comes to filetypes.

If I encounter a .pdf file, it downloads it, then dutifully asks me if I'd like to save it to disk. Thanks, lynx. It's like you read my mind or something.

If I encounter a .torrent file, lynx downloads it, then opens it with transmission-gtk.

Uh... no, lynx. I would have either preferred transmission-cli or just having the torrent file.

If I try to open a magnet URL, lynx doesn't know what to do with it. (Psst! transmission-cli, lynx!

But the worst is when I download .ogg, because lynx assumes that I want to play it with VLC in the TTY using caca to render the video as ASCII.

Bad lynx!

How do I whip lynx into shape? How do I customize this behavior? Editing /etc/lynx/lynx.cfg does not seem to do the trick.

share|improve this question
2  
Lynx uses mailcap(5) to display non-HTML stuff. Have you considered using elinks or w3m? –  Stephane Chazelas Feb 10 '13 at 21:18
1  
Have you tried sending lynx to bed with no dinner? –  terdon Feb 11 '13 at 2:39
add comment

1 Answer

up vote 4 down vote accepted

Lynx does the standard thing (unlike Firefox and Chrome) and uses the system's mailcap database. The system mailcap is in /etc/mailcap, and the per-user file is ~/.mailcap. Add entries like

application/x-bittorrent; transmission-cli '%s'; needsterminal
application/pdf; pdftotext '%s'; copiousoutput
application/ogg; vlc '%s'; test=test -n "$DISPLAY"
share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.