Subject: Re: FVWM: Shell scripts in FVWM menus

From: Dan Espen <[email-masked]>
Date: Sat, 15 Mar 2003 12:56:49 -0500

Timothy Groves <[email-masked]> writes:
> On Sat, 15 Mar 2003 12:39:43 -0500
> Dan Espen <[email-masked]> wrote:
> > > Okay, I've RTFM, and it doesn't address this question:  How exactly does 
> > > one run a shell script from an FVWM exec command?
> > 
> > Nothing special.  If the shell script is in your path, and
> > named "myshell":
> > 
> > Exec myshell
> 
> This fails on my system.  I'm using ROX Filer, which is one giant shell scrip
> t, and have tried calling it in my StartFunction as:
> 
> + I Exec rox -p=rakshasa
> + I Exec exec rox -p=rakshasa

Reply to the list, not the one answering.  (Sorry I haven't figured out
how to set the reply-to header correctly.)

Either of the first 2 forms should be fine.

I assume you tried it from the command line and it worked?

When you say it fails, does that mean nothing appears or are you
seeing a message?

Depending on how you started fvwm, error messages might be going to
different places.  Most likely, any error messages are in
$HOME/.xsession-errors.

-- 
Dan Espen                           E-mail: [email-masked]
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Timothy Groves <[email-masked]>
Date: Sat, 15 Mar 2003 13:37:49 +0000

On Sat, 15 Mar 2003 12:56:49 -0500
 
> how to set the reply-to header correctly.)

Sorry 'bout that.

> I assume you tried it from the command line and it worked?

That is correct.
 
> When you say it fails, does that mean nothing appears or are you
 
Nothing appears.
 
> different places.  Most likely, any error messages are in

Not even there does any error message appear.

-- 
ICQ#66022322

"Beer is living proof that God loves us and wants us to be happy."
-Benjamin Franklin
______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

---

From: "S. Anderson" <[email-masked]>
Date: Sat, 15 Mar 2003 20:17:37 -0700

> Not even there does any error message appear.

what does your shell script look like?

I have something like this in my menu, it works fine here.

AddtoMenu RootMenu
+ "Play DVD" exec /home/sa/bin/xine-play.sh

and /home/sa/bin/xine-play.sh is:
#!/bin/bash
aumix -v 99 -w 79 -i 79 -o 79&
xine -a 2 --auto-play -s dvd &

---

From: Timothy Groves <[email-masked]>
Date: Sat, 15 Mar 2003 22:16:10 +0000

On Sat, 15 Mar 2003 20:17:37 -0700

> + "Play DVD" exec /home/sa/bin/xine-play.sh

My shell script is the AppRun batch file for ROX Filer.  It's huge.  
The first four lines are:

#!/bin/sh

PROG=ROX-Filer

APP_DIR=`dirname $0`
APP_DIR=`cd "$APP_DIR";pwd`; export APP_DIR

Funny thing is, my Quake2 plays happily as a shell script.
-- 
ICQ#66022322

---

From: "S. Anderson" <[email-masked]>
Date: Sat, 15 Mar 2003 20:49:07 -0700

> Funny thing is, my Quake2 plays happily as a shell script.

mabey you could try running it with an xterm like:

+ "script" exec xterm -e shell_script.sh

> "Beer is living proof that God loves us and wants us to be happy."

:-)

---

From: Timothy Groves <[email-masked]>
Date: Sat, 15 Mar 2003 23:12:04 +0000

On Sat, 15 Mar 2003 20:49:07 -0700

> + "script" exec xterm -e shell_script.sh

Well, I tried it as:

xterm -e start-rox

and it failed.  Then I tried it as:

xterm -e pauseme start-rox

to see if it was throwing out any error messages...and it worked
perfectly...until I closed the XTerm.  Then it vanished.  So it doesn't
seem to out-live the launching XTerm.  Though starting it in an XTerm,
and allowing it to finish starting, then closing the XTerm, doesn't seem
to kill it.  Perhaps the problem's with -e?  But I can't think of a way
to launch it without it.
-- 
ICQ#66022322

---

From: parv <[email-masked]>
Date: Sun, 16 Mar 2003 02:55:39 -0500

in message <[email-masked]>, wrote
Timothy Groves thusly...
> perfectly...until I closed the XTerm.  Then it vanished.  So it
> doesn't seem to out-live the launching XTerm.  Though starting it
> in an XTerm, and allowing it to finish starting, then closing the
> XTerm, doesn't seem to kill it.  Perhaps the problem's with -e?

Well, i don't know (or care) what rox filer does.  If rox filer is
a bona fide GUI, say like xv, gv, etc. or works (or can work) in the
background, like splay or pslatex, then, of course, there is no need
for an xterm.  In that case, your script should just work.

If it runs in xterm, then you need something to keep that xterm
alive so that it doesn't die, as you have already found out.  And,
this particular issue was resolved in one of comp.unix.* groups.
Let's see... oh yes in comp.unix.shell ...

  http://groups.google.com/groups?th=87bb969e4a077afe

  - parv

--

---

From: Timothy Groves <[email-masked]>
Date: Sun, 16 Mar 2003 10:04:38 +0000

On Sun, 16 Mar 2003 02:55:39 -0500

> alive so that it doesn't die, as you have already found out.  And,

It is a GUI created with GTK+Python, and when launched manually from an XTerm, it completes and leaves the GUI running.  The XTerm can then be manually closed.  But if launched from an XTerm using -e, it closes as soon as the XTerm closes.
-- 
ICQ#66022322

---

From: Dan Espen <[email-masked]>
Date: Sun, 16 Mar 2003 10:50:06 -0500

Timothy Groves <[email-masked]> writes:
> It is a GUI created with GTK+Python, and when launched manually from an XTerm
> , it completes and leaves the GUI running.  The XTerm can then be manually cl
> osed.  But if launched from an XTerm using -e, it closes as soon as the XTerm
>  closes.

That sounds like it tries to maintain some kind of connection to
the invoking terminal.

Try using nohup.

---

From: Timothy Groves <[email-masked]>
Date: Sun, 16 Mar 2003 12:11:17 +0000

On Sun, 16 Mar 2003 10:50:06 -0500

> That sounds like it tries to maintain some kind of connection to

Like a charm!  Thanks for all the help, everyone.

-- 
ICQ#66022322