You are not logged in.

#1 2007-09-09 20:46:17

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Launching commands in a shell via the Fluxbox menu?

Is there a way I can configure ~/.fluxbox/menu so I can launch command-line progs in a shell?  For example, running jackd - I want to see the output in a shell as it runs.

Offline

#2 2007-09-10 00:11:31

Endperform
Member
From: Atlanta GA, USA
Registered: 2007-09-04
Posts: 94
Website

Re: Launching commands in a shell via the Fluxbox menu?

Yeah, you can, but you need to do it with a terminal (at least that's how I do it).  I have urxvt for my terminal, and say I wanted to start a python session.  I'd do:

(Python) {urxvt -e python}

in my menu, and up comes urxvt with my python session.  Once I close the session, though, the terminal exits.

Offline

#3 2007-09-12 08:22:00

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Launching commands in a shell via the Fluxbox menu?

With xterm, if you don't want the terminal to close when the application finishes, add the -hold flag.

But I cannot figure out how to get the following behavior via a single command:

1. open new terminal with a shell
2. execute a command under that shell

with the shell staying open for further commands.

That must be possible. Can I get a handle on the new shell and then pipe input to it? I don't really care if the shell is a login shell or inherits my current environment.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#4 2007-09-12 12:41:07

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: Launching commands in a shell via the Fluxbox menu?

It seems like there would be several ways to do what you want to do, but the one that comes to mind first is to use an environment variable. The menu entry would be something like this:

(Terminal+ls) {RUNCMD="ls -l" urxvt}

To make use of the environment variable, put something like this at the end of your shell rc:

if [ -n $RUNCMD ] ; then
    eval $RUNCMD
    unset RUNCMD
fi

Offline

#5 2007-09-12 19:27:29

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Launching commands in a shell via the Fluxbox menu?

Thanks! I did think of the rc file, but not of the environment variable. Nice trick.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

Board footer

Powered by FluxBB