LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 06-27-2008, 12:35 AM   #1
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Rep: Reputation: 16
start two applications with one icon


i'm trying to start two applications with one icon. heres what i have in the command line:

env WINEPREFIX="/home/administrator/.wine" wine "C:\Program Files\Ventrilo\Ventrilo.exe" | /home/administrator/Desktop/Downloads/ventriloctrl-0.3/runctrl.sh &

the first is the voice chat program ventrilo, for windows obviously, that i have working. the only problem is, if the ventrilo window is not in focus, the push to talk hotkey does not work.

so someone came up with a workaround, called ventrilo control. it is started with a simple shell script. this script needs to be run AFTER the ventrilo program is running, or it wont detect the window.

clicking my icon does start ventrilo, but it does not launch the shell script. how do i modify it to make it work? ive tried adding a /bin/sh before it, and putting it in quotes, but nothing works.

also, would it be possible to add a short, maybe 3 second delay to the launch of the shell script? actually, the shell script calls the executable for the control program in there, so i could even add the delay inside of the shell script before it launches the executable, if its possible. the reason for the delay would be to give time for the ventrilo window to open before launching the hotkey control program. i dont even know if i'll need the delay or not, but its something that crossed my mind.
 
Old 06-27-2008, 12:38 AM   #2
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: My HDD...
Distribution: WinXP for designing, Linux for life.
Posts: 2,329
Blog Entries: 1

Rep: Reputation: 47
Make a shell script that refers to the other script and to the program, than link the icon to that particular script.
 
Old 06-27-2008, 01:09 AM   #3
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
no shit. i cant believe i didnt even think of that. now i feel dumb... i'll go give that a try right now.

any ideas on the delay?
 
Old 06-27-2008, 01:20 AM   #4
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
as i suspected, i do need a delay. the control program starts faster than wine can open ventrilo. so the control program says it cant find the window, and terminates.
 
Old 06-27-2008, 02:33 AM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
The cmd in bash is

sleep 10

that's 10 (or whatever) seconds
 
Old 06-27-2008, 06:07 PM   #6
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
Thanks chris, the sleep command works.

I made a script called start_both.sh, and made it executable. heres whats in the file:

env WINEPREFIX="/home/administrator/.wine" wine "C:\Program Files\Ventrilo\Ventrilo.exe" &
sleep 5
/home/administrator/Desktop/Downloads/ventriloctrl-0.3/runctrl.sh &


If I start the script from a console window, everything works fine. ventrilo window appears, waits 5 seconds, and then I see the ventriloctrl program run in the console saying it found the window, and my hotkey works.

If I start the script with my icon that points to start_both.sh, the ventrilo window starts up, but the control program does not. I tried setting the icon to run in a command window to try to see what is happening, and when I did that, the ventrilo window actually closes after a few seconds. i set my sleep to 10, and it still closed after a few seconds... well before the sleep 10 would have been up. but it seems it terminates before it ever gets to running the control program.

again to recap... if the icon is set to not open in a console, the ventrilo window stays open, and the control program does not run. if i set it to run in a console window, the ventrilo window starts and dissapears after a few seconds, and the console window says 'finished' in the title bar.
 
Old 06-29-2008, 05:45 PM   #7
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: My HDD...
Distribution: WinXP for designing, Linux for life.
Posts: 2,329
Blog Entries: 1

Rep: Reputation: 47
If you put an "&" after the program that ends, then try it, I think that may solve your problem of "self closure".
 
Old 06-30-2008, 02:40 AM   #8
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
in my start_both.sh file i posted above, i already have an ampersand after both programs.
 
Old 06-30-2008, 01:35 PM   #9
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
Making a separate Icon just for the program:
/home/administrator/Desktop/Downloads/ventriloctrl-0.3/runctrl.sh

The program does not start like this. The console window just opens and immediatly closes, even when I click the checkbox to run in a console window. I seem to only be able to start this script directly from a console window.

any ideas as to why?
 
Old 07-01-2008, 10:18 AM   #10
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: Various Debian derivitives
Posts: 159

Rep: Reputation: 19
Quote:
Originally Posted by pepsimachine15 View Post
Making a separate Icon just for the program:
/home/administrator/Desktop/Downloads/ventriloctrl-0.3/runctrl.sh

The program does not start like this. The console window just opens and immediatly closes, even when I click the checkbox to run in a console window. I seem to only be able to start this script directly from a console window.

any ideas as to why?
If you insert a double ampersand "&&" between the two commands, it will probably work. That double ampersand says to BASH "when you have finished the first command go on to the second" so if (for whatever reason) the first command is not finished the second won't even start.
 
Old 07-01-2008, 04:12 PM   #11
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
forget trying to start both commands at once for a minute. i cant even get the second command to start by itself. it runs fine if i type ./runctrl from a console window. but as soon as i make a new icon in KDE and point it to runctrl, it does not start. a console window just opens and immediatly exits. no error messages.
 
Old 07-01-2008, 07:10 PM   #12
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Use Skype instead of Ventrilo. If you insist on using Ventrilo, write a shell script to load up Ventrilo and have the script sleep for a few seconds. Then use an if statement to check if Ventrilo is running. If it is running, the Ventrilo shell script can run. Another way is to bind a key to the Ventrilo bash script to a button. When it is press, the script is run.

The reason why I suggest Skype is because it works in Linux and many operating systems. It will not be easy as Ventrilo to speak to many people at once or join in the group, but it should work.

Try venting to Ventrilo developers to support Linux. They can easily do this by using Qt from Trolltech to simplify the tasks to make a GUI program and for porting code to different operating systems.
 
Old 07-03-2008, 09:56 PM   #13
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
I appreciate your sugguestion, but please do not refer me to other applications for VOIP chat. Ventrilo must be used because I play in an online league and the team I play with uses ventrilo. I cannot force everyone else to switch just because of me.

Checking if ventrilo is running is not an issue. I have my script set up to sleep, and then start the hotkey control application after ventrilo is running.

My problem is that the control application will not start with an icon. It starts fine via command line, but whenever i set up an icon pointing to my control app, the control program will not start. I need to find out the cause of this, or i will need to manually open a terminal, cd to the control script directory, and manually start it each time i run ventrilo. this is rather annoying, as clicking on an icon is one of the many reasons x-windows was developed. point, click. once I get the control script to start via icon, i can easily combine the two into one startup script run from an icon.

venting to the ventrilo developers is futile. they have had a 'linux' section on their forums for the past 3 years, which is locked, with a single post saying 'linux ventrilo coming soon'. any posts about linux ventrilo on their forums is immediatly removed. google linux ventrilo, you will see what i mean.
 
Old 07-04-2008, 04:30 AM   #14
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
I have tried setting up a Windows program that runs in Wine from my launch bar (similar to icon), but it does not work. It just stalls. Wine developers needs to fix this bug, so it can load from an icon.

You could do the following.

xterm -e program

No offense, I think you need to stop being lazy and just type the program at the command line.


You could have the whole team switch to Mumble which should work in Windows, Mac, and Linux. Since it is an open source project, it will provide better support than what Ventrilo can provide.


BTW, It is X Window not x-windows or X Windows. Also X Window was designed to provide a GUI environment. It did not provide a point and click method.
 
Old 07-04-2008, 05:14 PM   #15
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: Various Debian derivitives
Posts: 159

Rep: Reputation: 19
[QUOTE=pepsimachine15;3203469]
My problem is that the control application will not start with an icon. It starts fine via command line, but whenever i set up an icon pointing to my control app, the control program will not start. ....

I have on several occasions set up a command line with an icon as point and click. I most familiar with Mepis and KDE. but I imagine that any X system could manage something equal.

Write your command line (the one that does what you want it to do), and then save it as a text file. change itś properties to include "executable"
and try it but clicking on it. If it still works properly, in KDE you can click on you "panel" choose "add application" and then "non-kde application". (This file is now a short script - it would be good to change the extension from "txt" to "sh")

In the window that pops up give the button an appropriate title and description. On the line labeled "executable"insert the path and file name for the script you have just written. Click on the icon and choose one of the icons that may seem more appropriate to you.

That script can include two or more commands separated by double ampersand, e.g. "&&".
. littlejoe5
 
  


Reply

Tags
application, icon, kde, launcher, linux, script, shell, wine


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
minimize applications to desktop icon or screenshots xpromisex Linux - Desktop 1 11-29-2006 12:25 AM
YaST wont execute from icon on the applications menu! stephen_lewitowski Suse/Novell 1 06-29-2006 11:58 AM
Click on Start icon nothing happens acaverzasi Mandriva 3 12-17-2005 10:22 PM
start icon acrors Red Hat 1 09-28-2004 05:50 PM
fc2-gnome : Applications dont start / very slow to start nox104 Linux - Software 0 08-18-2004 09:53 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration