El lunes 19 de junio a las 02:51:00 CEST, Cameron Simpson escribió: > On 18Jun2006 17:16, Leonardo Caldas <leonardo.caldas@xxxxxxxxx> wrote: > | I'd like to know wheter is possible or not when seeing an attached file, put > | it in background and keep normally seeing the other msgs. > | > | For example: > | > | I got this in my mailcap refering to mp3 files: > | > | audio/mpeg; mpg321 -d esd '%s' > /dev/null & sleep 5; description="MP3 > Audio File" > | > | The desired behavior is when opening an attached mp3 file in a msg, it > | will call the desired application, start to play the file and free > | the prompt, so that i could go see other messages, or even see another > | attached files. And of course, the same going with pictures (opening > | display - or whatever is my favorite picture viewer - and being > | possible to keep the file open while seeing other messages) and other > | types of files... > | > | I've already seen a couple of sources (mutt wiki and freenode's #Mutt > | included), but I got no help. Thanks in advance for your help. > > It should work. Bear in mind that you need two types of mailcap entries > in mutt. One should have the "copiousoutput" keyword; this is the entry > that will be used to process the file in the "message display" mode. > The entry without that keyword is used to open the file from the > attachments menu. > > For example, my image/jpeg lines are like this: > > image/jpeg; ah %s -end xv; gui > image/jpeg; noui iminfo %s; copiousoutput > > The second one recites a little information about the JPEG file in-line in > the message text when I view the message (size, etc). > > The first one is used when I open the jpeg in the attachments menu. You can > ignore the "gui" keyword; it's one of my own that one of my scripts uses when > it really wants a GUI app. > > Now, "ah" is a handler script of mine that kicks off an image viewer (for > JPEGs, anyway) and also offers to save the file. You want mpg123 for you case > I expect. > > For your needs you would do exactly as you have, with some changes: > > audio/mpeg; mpg321 -d esd %s >/dev/null 2>&1 </dev/null & ; > description="MP3 Audio File" > audio/mpeg; ls -ldh -- %s; copiousoutput description="MP3 Audio File" > > Notice that we have closed stdin (just in case) and also sent standard error > to /dev/null. (BTW, why the "sleep 5"?) > > Also, you should not need the quotes - "%s" is supposed to be replaced > with a shell-safe filename, so mutt should be putting in quotes > if necessary (in practice it does not, because it refuses to create > filenames which would need quoting). > > Now, in spite of all this, I would have expected your mailcap line to > work. Can you go into some detail about how it fails? It does not work for me at least. I have the following entry in my .mailcap file: text/html; dillo %s >/dev/null 2>&1 </dev/null & ; description "HTLM Files" and dillo complains about the input file has vanished. I think mutt removes the file when no process holds the file open, as it uses the unlink system call after the temp file is created. I have the following setting set tmpdir=~/.mutt/tmp (i.e, not the /tmp sticky directory) Regards
Attachment:
pgpmXny7ssAiq.pgp
Description: PGP signature