LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-10-2011, 05:33 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
xterm -e doesn't get associated with transfer protocol mms.


Kernel 2.6.21.5, Slackware 12.0
Desktop environment= Xfce 4.4.1
(Mozilla) Firefox 2.0.0.4

Hi:
Writing about:config in the address bar of the web browser (Firefox) I get
Code:
network.protocol-handler.app.mms          /usr/local/bin/mplayer
network.protocol-handler.external.mms     true
These lines were added by me and this way all's fine: when I click on a link associated with an mms://... URL mplayer gets in charge. However, I have not mplayer compiled with a graphical front-end (and wouldn't wish to do so). If I had it, I presume mplayer's audio console would appear drawn on the screen. What happens is that mplayer opens in no terminal, graphical or text, and I lose interaction with it (e.g., I won't be able to press the 'p' key to make it pause). If I want mplayer to stop (cancel execution) I must kill it.

I tried two remedies: as a value for network.protocol-handler.app.mms I substituted /usr/bin/xterm -e /usr/local/bin/mplayer for the value shown above. This made firefox to notify, when I clicked on an audio stream link (mms), there was no program associated with the mms protocol.

That having proved unsuccessful, I tried this: I made a script, sc2.sh, namely,
Code:
#!/usr/bin/sh
/usr/bin/xterm -e /usr/local/bin/mplayer
Then, as the value for network.protocol-handler.app.mms, I put /home/semoi/sc2.sh. This time, firefox didn't complain but xterm must have exited immediately, if it ran at all, 'cause ps did not find it.

When you run xterm with the -e option, xterm opens a window, runs the program in the window and, when the program ends execution, xterm exits. If the program is mplayer playing a 30m long file, I can see mplayer's output to stdout, and mplayer will accept input from stdin. Which, for me, is the ideal scenario.

But I am unable to produce this scenario and I'm not even sure it can be done. Any suggestion would be welcome.

Last edited by stf92; 06-10-2011 at 08:04 PM.
 
Old 06-11-2011, 02:15 AM   #2
shanek54
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Rep: Reputation: 0
Have you considered using /usr/bin/screen? I have no idea if it would work, and can't test at the moment, but I use it as a "disconnected" terminal all the time...
 
Old 06-11-2011, 05:04 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Kind of you, shanek54, to have posted back. I was considering your proposition, when a doubt assaulted me. I clicked the link, and payed very careful attention to see what happened on the screen. To my surprise, I could verify sc2.sh (second code block above) got executed and, with it, mplayer. And then, xterm immediately exited.

Then I understood it was the natural thing to happen: mplayer has no argument in its command line! As a consequence, it displays its version number, usage and exits, as it would do if invoked directly from a console. What I have to do is to rewrite the script so that it accepts an input argument. I hope this will do. Regards.

Last edited by stf92; 06-11-2011 at 05:51 AM.
 
Old 06-11-2011, 05:46 AM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Before, sc2.sh was
Code:
#!/usr/bin/sh
/usr/bin/xterm -e /usr/local/bin/mplayer
Now, it is
Code:
#!/usr/bin/sh
/usr/bin/xterm -e /usr/local/bin/mplayer $1
And the whole thing is working just fine. Kind regards.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xterm - howto lauch an xterm into a specific directory jobano Linux - Software 11 01-30-2023 04:45 AM
XTerm(241) support for truetype fonts and method of changing XTerm font. ajassat Linux - Software 2 08-19-2009 12:01 PM
When I tries to execute the xterm i got this message: xterm: no available ptys johnsanty Other *NIX 4 09-20-2006 12:29 PM
xterm alt becomes compose? Only xterm affected. -0- Linux - Software 0 09-12-2006 11:59 PM
how is black xterm background in IceWM when issue a xterm command? BRAHmS Linux - Software 1 02-14-2005 03:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration