Re: Mailcap and piping

2011-03-20 Thread Christian Ebert
* Veljko on Saturday, March 19, 2011 at 23:55:59 +0100
 On Sat, Mar 19, 2011 at 11:52:22PM +0100, Veljko wrote:
 On Sat, Mar 19, 2011 at 08:49:43PM +0100, Christian Ebert wrote:
 * Veljko on Saturday, March 19, 2011 at 16:05:18 +0100
 Just out of curiosity, how to use pipe (|) to open attachment with
 desired application?
 
 You can just leave out the filename expando (%s). For example:
 
 application/pdf; xpdf /dev/stdin
 
 Sorry, I understand that my subject contribute to the confusion. What I
 was asking was using pipe in view-attachment part. When rely on mailcap
 entries is is sufficient to pres enter (and that is working now), but 
 alternative is to press |
 and enter command, that is, we are asked to Pipe to:. Maybe I
 misunderstood it's usage...
 
 To be more clear, I'm refering to this:
 pipe-message   |   pipe message/attachment to a shell command

And the question is? ;-) Why not try it out? It does just what it
says, according to your current pipe-related settings like
pipe_decode. And you can use/test it from Mutt's commandline or
in macros. You just enter the command at the pipe-message prompt
manually or write it in the macro.

But I am quite certain that I don't understand what your question
is, sorry.

c
-- 
\black\trash movie   _SAME  TIME  SAME  PLACE_
   New York, in the summer of 2001

--- http://www.blacktrash.org/underdogma/stsp.php


Re: Mailcap and piping

2011-03-20 Thread Veljko
On Sun, Mar 20, 2011 at 01:25:05PM +0100, Christian Ebert wrote:
 * Veljko on Saturday, March 19, 2011 at 23:55:59 +0100
  On Sat, Mar 19, 2011 at 11:52:22PM +0100, Veljko wrote:
  On Sat, Mar 19, 2011 at 08:49:43PM +0100, Christian Ebert wrote:
  * Veljko on Saturday, March 19, 2011 at 16:05:18 +0100
  Just out of curiosity, how to use pipe (|) to open attachment with
  desired application?
  
  You can just leave out the filename expando (%s). For example:
  
  application/pdf; xpdf /dev/stdin
  
  Sorry, I understand that my subject contribute to the confusion. What I
  was asking was using pipe in view-attachment part. When rely on mailcap
  entries is is sufficient to pres enter (and that is working now), but 
  alternative is to press |
  and enter command, that is, we are asked to Pipe to:. Maybe I
  misunderstood it's usage...
  
  To be more clear, I'm refering to this:
  pipe-message   |   pipe message/attachment to a shell command
 
 And the question is? ;-) Why not try it out? It does just what it
 says, according to your current pipe-related settings like
 pipe_decode. And you can use/test it from Mutt's commandline or
 in macros. You just enter the command at the pipe-message prompt
 manually or write it in the macro.
 
 But I am quite certain that I don't understand what your question
 is, sorry.
 
 c

Well, I tried it and it doesn't work. I have some .wmv file attached in
mail. After Ctrl-v I'm in position to press enter after selecting
attachment. Something like:
A 4 some_video_file.wmv  [video/x-ms-wmv, base64, 1.3M]
If I press enter, video file is started in mplayer, bacause it is set that
way in my mailcap and that's fine. But if I want to play it in VLC, I
thought I can press | and enter command that will start my attached
video file. It doesn't work. pipe_decode doesn't make any difference.

But it doesn't really matter. I was just being curious about it. :-)



Re: Mailcap and piping

2011-03-20 Thread Christian Ebert
* Veljko on Sunday, March 20, 2011 at 15:30:44 +0100
 Well, I tried it and it doesn't work. I have some .wmv file attached in
 mail. After Ctrl-v I'm in position to press enter after selecting
 attachment. Something like:
 A 4 some_video_file.wmv  [video/x-ms-wmv, base64, 1.3M]
 If I press enter, video file is started in mplayer, bacause it is set that
 way in my mailcap and that's fine. But if I want to play it in VLC, I
 thought I can press | and enter command that will start my attached
 video file. It doesn't work. pipe_decode doesn't make any difference.

I don't know VLC and what it accepts as arguments, but with
mplayer this works at the Mutt pipe-entry prompt:

mplayer -

or

mplayer /dev/stdin

Find out if and how VLC accepts standard input as an argument.

 But it doesn't really matter. I was just being curious about it. :-)

In practice you would use pipe-message and pipe-entry for text
content mainly I would think.

c
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


Re: Mailcap and piping

2011-03-20 Thread Veljko
On Sun, Mar 20, 2011 at 05:52:39PM +0100, Christian Ebert wrote:
 I don't know VLC and what it accepts as arguments, but with
 mplayer this works at the Mutt pipe-entry prompt:
 
 mplayer -
 
 or
 
 mplayer /dev/stdin
 
 Find out if and how VLC accepts standard input as an argument.

Tried with mplayer and the result is:
Playing /dev/stdin.
Cannot seek backward in linear streams!
Seek failed

or

Playing -.
Reading from stdin...
Cannot seek backward in linear streams!
Seek failed

  But it doesn't really matter. I was just being curious about it. :-)
 
 In practice you would use pipe-message and pipe-entry for text
 content mainly I would think.
 
 c

Yeah, I guess you are right, not really intended to be used with
multimedia.



Re: Mailcap and piping

2011-03-20 Thread Veljko
On Sun, Mar 20, 2011 at 11:06:32AM -0700, Chip Camden wrote:
 Here's a little script I use to move stdin to a file argument:
 
 
 #!/bin/sh
 needsterm=false
 while getopts th o; do
   case $o in
   t)  needsterm=true;;
   h)  echo 2 Usage: $0 [-t] cmd
   exit 1;;
   esac
 done
 shift `expr $OPTIND - 1`
 file=`mktemp /tmp/farg.XX`
 cat  $file
 if $needsterm; then
   `printf $* $file`  /dev/tty
 else
   `printf $* $file`
 fi
 rm $file
 
 
 I call it 'farg'.
 
 Now you can use mutt's pipe command for any command that accepts a file
 argument:
 
 |farg 'mplayer %s'
 
 for commands that want stdin to be the terminal, add -t:
 
 |farg -t 'vim %s'
 
 -- 
 Sterling (Chip) Camden | sterl...@camdensoftware.com | 2048D/3A978E4F
 http://chipsquips.com  | http://camdensoftware.com   | http://chipstips.com

Thanks Chip, that worked!



Re: Mailcap and piping

2011-03-20 Thread Chip Camden
 Quoth Veljko on Sunday, 20 March 2011:
  On Sun, Mar 20, 2011 at 05:52:39PM +0100, Christian Ebert wrote:
   I don't know VLC and what it accepts as arguments, but with
   mplayer this works at the Mutt pipe-entry prompt:
   
   mplayer -
   
   or
   
   mplayer /dev/stdin
   
   Find out if and how VLC accepts standard input as an argument.
  
  Tried with mplayer and the result is:
  Playing /dev/stdin.
  Cannot seek backward in linear streams!
  Seek failed
  
  or
  
  Playing -.
  Reading from stdin...
  Cannot seek backward in linear streams!
  Seek failed
  
But it doesn't really matter. I was just being curious about it. :-)
   
   In practice you would use pipe-message and pipe-entry for text
   content mainly I would think.
   
   c
  
  Yeah, I guess you are right, not really intended to be used with
  multimedia.
 
 Here's a little script I use to move stdin to a file argument:
 
 
 #!/bin/sh
 needsterm=false
 while getopts th o; do
   case $o in
   t)   needsterm=true;;
   h)   echo 2 Usage: $0 [-t] cmd
exit 1;;
   esac
 done
 shift `expr $OPTIND - 1`
 file=`mktemp /tmp/farg.XX`
 cat  $file
 if $needsterm; then
   `printf $* $file`  /dev/tty
 else
   `printf $* $file`
 fi
 rm $file
 
 
 I call it 'farg'.
 
 Now you can use mutt's pipe command for any command that accepts a file
 argument:
 
 |farg 'mplayer %s'
 
 for commands that want stdin to be the terminal, add -t:
 
 |farg -t 'vim %s'
 
 -- 
 Sterling (Chip) Camden | sterl...@camdensoftware.com | 2048D/3A978E4F
 http://chipsquips.com  | http://camdensoftware.com   | http://chipstips.com

-- 
Sterling (Chip) Camden | sterl...@camdensoftware.com | 2048D/3A978E4F
http://chipsquips.com  | http://camdensoftware.com   | http://chipstips.com


pgpui6HtmK0tE.pgp
Description: PGP signature