LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-11-2008, 10:58 AM   #1
srunni
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Rep: Reputation: 15
Detaching Amarok from bash script run from KMenu


Hi,

I'm using a bash script run from the KMenu to launch Amarok, so that I can mount the NFS share on which my music directory is located. The script checks to see if the directory is mounted. If not, it attempts to mount it. If the directory is mounted at that point, it launches Amarok. Otherwise, it terminates. This makes sure that Amarok doesn't launch without the music directory mounted, which would require me to rebuild the collection the next time I open it with the directory mounted.

Anyway, my problem is with launching the script from the KMenu. When I run the script from the terminal, just using
Code:
amarok
will allow me to close the terminal after Amarok's been launched, without any problems with Amarok terminating as well. But when I launch the script from the KMenu, none of the following (which I found online) work for me:

Code:
amarok
Code:
amarok &
Code:
( ( amarok & ) & )
Code:
amarok
disown %1
Code:
amarok &
disown %1
Code:
( ( amarok & ) & )
disown %1
Any ideas on how to get this to work?

Thanks!

Last edited by srunni; 08-11-2008 at 11:00 AM.
 
Old 08-11-2008, 11:17 AM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Try $(nohup amarok).

*shrug* I can't give any explanation as to why you should try it, I just know it's worked for me in the past to keep applications from closing until they are terminated through their built in calls.
 
Old 08-11-2008, 11:22 AM   #3
srunni
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Original Poster
Rep: Reputation: 15
I'm getting there - now it's not closing the terminal once the script terminates, but when I close the terminal manually, Amarok stays open. Any chance you'd know how to automatically close the terminal as well? I tried
Code:
exit
and it didn't work.

Last edited by srunni; 08-11-2008 at 11:24 AM.
 
Old 08-11-2008, 12:23 PM   #4
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Is it necessary for the terminal to show when the script is being run? I only ask because it sounds like you have the "Run in terminal" box checked, in which case it's a simple fix - just uncheck the "Run in terminal" box.
 
Old 08-11-2008, 02:26 PM   #5
srunni
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Well, I'd like to see the output that the NFS share couldn't be mounted. But I guess if there's no way around it, I'll just uncheck that.
 
Old 08-11-2008, 02:55 PM   #6
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I realize it's a slightly unnecessary step, but you could use a package like Zenity to provide a GTK+ message box to tell you if the NFS shares were mounted successfully or not -- it's like "dialog" but provides a nice GTK+ interface, and is used by the command-line.
 
Old 08-11-2008, 04:39 PM   #7
srunni
LQ Newbie
 
Registered: Jun 2007
Posts: 24

Original Poster
Rep: Reputation: 15
Is there a way to do that with Qt? ;/
 
Old 08-12-2008, 02:09 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Take a look at kdialog
http://www.linuxtopia.org/online_boo...y.html#kdialog
 
  


Reply

Tags
amarok, bash, kmenu, nfs



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
Create and run a bash script BallsOfSteel Programming 9 07-04-2008 12:48 AM
Bash Script Help - Trying to create a variable inside script when run. webaccounts Linux - Newbie 1 06-09-2008 02:40 PM
how to run one bash script from within another? babag Programming 9 04-28-2005 12:12 AM
Run script at login instead of bash uzi4u Linux - General 2 04-28-2004 02:31 PM
how to run shell script from Kmenu? Howloweener Linux - Newbie 1 05-01-2003 02:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:33 AM.

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