LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 07-06-2008, 10:52 PM   #16
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16

electro -

the program I am trying to start from an icon is not a windows program using wine. it is a non-gui application, normally run from command line, written for linux. it is started with a shell script called "runctrl.sh" that calls an executable.

being lazy has nothing to do with this. if thats what you think it is, try running your favorite app every day, and then needing to load up a console window on top of that, cd to a directory, and start a shell script just so you can use your app. maybe then you will see why this can get quite annoying.

The entire team does not need to switch to mumble. It is quite unreasonable to ask everyone else to switch to a different chat program just for one user's compatibility issues. not to mention, they would still need to keep ventrilo installed to join another teams vent server, or a pub's vent server, or even a private friend's server. This is what the counter strike source gaming community uses (for the most part, besides occasional teamspeak servers), and there is no way my entire team will switch to different software, end of story.

yes, 'X Window' was designed to provite a GUI environment. pointing and clicking is just one of the many features of a GUI environment.

littlejoe5 -

what you described is pretty much what i have done. the problem is, my .sh shell script just wont start with an icon. typing ./runctrl.sh from a terminal works perfectly. clicking the panel, adding a non-kde application, and pointing the 'executable' line to runctrl.sh does NOT start the shell script. a terminal window just opens and closes real quick.


Everyone -

I appreciate everyone trying to be helpful, but i do not need any more suggestions to switch to different software. and I dont need anyone to tell me to quit being lazy and deal with it. Ventrilo and Wine are not the issue here. starting a simple, non-gui, command line app written for linux, using an icon is. program starts fine via terminal. program does not run starting via icon.

here is a link to the command line app i'm having issues with:
http://np1.pp.fi/ventriloctrl/ventriloctrl-0.3.tar.gz
 
Old 07-07-2008, 05:45 AM   #17
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Quote:
Originally Posted by pepsimachine15 View Post
electro -

the program I am trying to start from an icon is not a windows program using wine. it is a non-gui application, normally run from command line, written for linux. it is started with a shell script called "runctrl.sh" that calls an executable.

being lazy has nothing to do with this. if thats what you think it is, try running your favorite app every day, and then needing to load up a console window on top of that, cd to a directory, and start a shell script just so you can use your app. maybe then you will see why this can get quite annoying.

The entire team does not need to switch to mumble. It is quite unreasonable to ask everyone else to switch to a different chat program just for one user's compatibility issues. not to mention, they would still need to keep ventrilo installed to join another teams vent server, or a pub's vent server, or even a private friend's server. This is what the counter strike source gaming community uses (for the most part, besides occasional teamspeak servers), and there is no way my entire team will switch to different software, end of story.

yes, 'X Window' was designed to provite a GUI environment. pointing and clicking is just one of the many features of a GUI environment.
Setting an icon to launch runctl.sh should work. Just use the full path to it. To make it easily be run, create a directory in your home directory like bin and then include in the PATH environment variable. Copy findwindow, ventriloctrl, and runctl.sh to that directory that you created. When the script is run from the icon, it should work.

You may want to change the runctl.sh script to the following.

Code:
#!/bin/sh

# Config, see README for instructions
EVENT_DEVICE="/dev/input/event0"
INPUT_KEY="86"

xterm -e "ventriloctrl $EVENT_DEVICE $INPUT_KEY && sleep 10"
Of course you will need to include a path in PATH or else you will have to provide the full path.

To include a path in the PATH variable and assuming the directory $HOME/bin is the desire path to add, do the following.

export PATH=$PATH:$HOME/bin

BTW, I have not tested the code above for the new runctl.sh.
 
Old 07-07-2008, 08:25 AM   #18
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
i assumed you meant findkey not findwindow, so i copied that and the other two to /home/administrator/bin

The above change to runctrl.sh worked, only after adding $HOME/bin to my path of course.

is there any way to get xterm to run silently in the background? if not, I can deal with the extra xterm window created for the process.
 
Old 07-07-2008, 02:25 PM   #19
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: Various Debian derivitives
Posts: 181

Rep: Reputation: 19
You may be completely right. I have discovered that many programs that must be started from command line won start properly from the "Run Command" listed in the GUI menu. But I did notice in the paragraph below that your called the shell script with itś entire path from the terminal, but did you list the whole pathname in the 'execvutable' line while adding a non-kde application? I learning from you on this.
. littlejoe5

Quote:
Originally Posted by pepsimachine15 View Post
electro -


littlejoe5 -

what you described is pretty much what i have done. the problem is, my .sh shell script just wont start with an icon. typing ./runctrl.sh from a terminal works perfectly. clicking the panel, adding a non-kde application, and pointing the 'executable' line to runctrl.sh does NOT start the shell script. a terminal window just opens and closes real quick.



here is a link to the command line app i'm having issues with:
http://np1.pp.fi/ventriloctrl/ventriloctrl-0.3.tar.gz
 
Old 07-07-2008, 10:40 PM   #20
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
littlejoe5-

yes, i had the entire path in the executable section. i also tried with quotes, without quotes, with a /bin/sh before it, with an ampersand after it. nothing seemed to work. adding it to my $PATH and opening with xterm as electro suggested was the only thing that has worked so far. and it's still not perfect (doesnt run in the background) but thats something i can deal with, as long as everything works the way it should.

i'm still tinkering with it, trying to get it to be a background process.
 
Old 07-07-2008, 11:56 PM   #21
pepsimachine15
Member
 
Registered: Jun 2008
Posts: 122

Original Poster
Rep: Reputation: 16
solution

well, after a lot of tinkering, i finally got it to work. heres what the problem was:

the "runctrl.sh" script was calling the executable "ventriloctrl". i'm assuming when i CD to the directory that both programs reside in within a terminal window, the path is automatically set to whatever working directory i am in. so starting runctrl.sh from that working directory, everything ran fine.

however when setting up an icon, the full path is used to run the shell script runctrl.sh, and there was no working directory set, or it must be set to some kde panel directory, because the 'ventriloctrl' executable is not found in the path, and the script terminates without starting the control program.

So, i added the full path to the control program in runctrl.sh (in the line that said "dont touch", ha.) after that, i was able to call runctrl.sh from an icon, and everything worked. I then wrote a script called start_both.sh to run both ventrilo via wine, and the control program.

heres the shell script for anyone who might run into the same problem. this will start ventrilo, and run the control program. it will also kill the control program(s) whenever you exit ventrilo. remember to enter the full path into your 'runctrl.sh' before 'ventriloctrl', or the control program will never start. and remember to change any other paths in the script below to whatever suits your system.

----------------begin code----------------

#!/bin/sh

### USED TO START VENTRILO AND HOTKEY CONTROL ###


#set variables
SERVICE="Ventrilo.exe"
RUNNING="no"


#start ventrilo with wine
env WINEPREFIX="/home/administrator/.wine" wine "C:\Program Files\Ventrilo\Ventrilo.exe" &


#keep checking if ventrilo.exe has started yet
while [ "$RUNNING" = "no" ]
do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "ventrilo.exe is running, wait 3 seconds and start control program."
sleep 3
/home/administrator/Desktop/Downloads/ventriloctrl-0.3/runctrl.sh &
RUNNING="yes"
else
echo "ventrilo.exe NOT running, keep checking..."
fi
done


#keep checking if ventrilo.exe is still running
while [ "$RUNNING" = "yes" ]
do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "ventrilo.exe is running, keep checking"
else
echo "ventrilo.exe NOT running, kill control program(s)..."
killall runctrl.sh
killall ventriloctrl
killall start_both.sh
fi
done

-----------------end code-------------------

thanks to electro for bringing up my $PATH, thats the reason i figured it out.
 
  


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