You are not logged in.

#1 2010-12-31 00:02:28

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Making an xterm launch something and then exit

Is this possible?

I've come up with a very primitive way to change FD.O file associations in Rox - basically i have a script in the Send To menu folder that runs 'xterm -e mimeopen -d' on whatever file it is, giving you a terminal with a choice of applications. I just have two problems:

1. After you choose the application, the terminal persists, and hitting ctrl-C in it will of course quit the application it launched.
2. More importantly, the terminal exits on its own immediately after executing whatever application, which is ugly and generally not good.

So ideally I'd like to:
- Launch the terminal and have it display the 'mimeopen -d' text.
- Execute the chosen application on the file, then disown the application's process.
- Kill the terminal.

Is this possible using just a bash script, or would I have to hack around with mimeopen itself?

Last edited by Gullible Jones (2010-12-31 00:02:56)

Offline

#2 2010-12-31 01:40:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Making an xterm launch something and then exit

1. Try

nohup xterm -e mimeopen -d .xinitrc &

2. Use '-hold'

xterm -hold -e htop

Last edited by karol (2010-12-31 02:11:21)

Offline

#3 2010-12-31 02:16:31

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Making an xterm launch something and then exit

Hmm, nohup is almost what I'm looking for. Ideally I'd like the xterm to exit after launching the application, but nohup will do for now... Thanks.

Offline

Board footer

Powered by FluxBB