LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2004, 12:56 PM   #1
sanger440
LQ Newbie
 
Registered: Feb 2004
Distribution: Thizlinux
Posts: 10

Rep: Reputation: 0
shell script link/shortcut in KDE


I am running an offshoot of Redhat 8.0 under a distro call ThizLinux 7.0. Very friendly version of linux, good for a newbie like myself. I wrote a little bash script file that will start my BF1942 dedicated server. The script works when I execute in from xterm. Now here is my question:

How can I execute this script from a shortcut on my KDE desktop?

It would be convenient to just have a link/shortcut on my desktop that will open up xterm and start my game server using the script. I do not have any commands in the script that opens xterm, not sure if it is needed.

Any ideas?
 
Old 02-12-2004, 02:07 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"How can I execute this script from a shortcut on my KDE desktop?"

You can create a desktop icon for the script by right clicking on an empty spot on the desktop.
In the pop up menu select Create New -> Link to Application. Fill out the form. On the Execute page be sure to click on Run in terminal.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites
 
Old 02-12-2004, 02:40 PM   #3
sanger440
LQ Newbie
 
Registered: Feb 2004
Distribution: Thizlinux
Posts: 10

Original Poster
Rep: Reputation: 0
I tried that. With the run in terminal box checked, a termal pops up and then closes so fast I cannot read what it says. I have tried every combo I can think of using the kde shortcut. Basicall my script just changes a directory and then starts the game server. Do I need something in my bash script to open a termal first and then start the server?

Not sure what to try next.
 
Old 02-12-2004, 03:07 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"With the run in terminal box checked, a termal pops up and then closes so fast I cannot read what it says."

It is normal behavior for the terminal to close when the script ends. If you want the terminal to stay open then open a terminal and type in your script at the command prompt. The terminal will stay open after your script ends and you can read any error messages that appear. After you get the script debugged then you can go back to running it from the desktop.

You can close your open terminal with the exit command.


---------------------
Steve Sites
 
Old 02-12-2004, 04:07 PM   #5
toastermaker
Member
 
Registered: Oct 2003
Location: coastal alabama, united states
Distribution: Mandrake 10.0 official, slackware 9.1
Posts: 219

Rep: Reputation: 30
Are you running your script as su? Does it contain commands that only su can run?
If so the following link may help a little. I had same prob getting script to run from desktop shortcut, for me it was permissions problem. Good luck.

http://www.linuxquestions.org/questi...le+not+working
 
Old 02-12-2004, 04:34 PM   #6
sanger440
LQ Newbie
 
Registered: Feb 2004
Distribution: Thizlinux
Posts: 10

Original Poster
Rep: Reputation: 0
I am running the script as su. A xterm window opens and closes quickly so I think the script file is executing. What the script is supposed to is start a game server. If I execute the script from xterm, it does. If I execute the script from the kde shortcut, xterm pops open for a split second, then closes, but no game server is running. I guess I need the script file to actually open a xterm window, change to the proper directory, and then start the server. Not sure how to do this.
 
Old 02-12-2004, 05:12 PM   #7
toastermaker
Member
 
Registered: Oct 2003
Location: coastal alabama, united states
Distribution: Mandrake 10.0 official, slackware 9.1
Posts: 219

Rep: Reputation: 30
when working properly, you will still get the same "open and close to fast to read" bit.
that doesnt mean the script isnt working.
from your most recent post it does indeed seem that permissions is the problem.


Someone more knowledgeble please help with this.
in the mean time look into permissions. good luck

<edit>

perhaps to test for permission problems you could open the xterm and try to run the script as a regular user, if you dont have any errors that way then it probably isnt permission problems after all.

hopefully jailbait will get back to you.good luck

Last edited by toastermaker; 02-12-2004 at 05:20 PM.
 
Old 02-12-2004, 05:37 PM   #8
sanger440
LQ Newbie
 
Registered: Feb 2004
Distribution: Thizlinux
Posts: 10

Original Poster
Rep: Reputation: 0
Finally got it to work. The shortcut was executing the script and starting the server, I just did not know it. So I added :

xterm -a bfsmd

to the script, and it opened xterm, then started the server. Now I see the sever in an xterm window, which is what I wanted. Works perfectly now. Thanks for the help.
 
  


Reply



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
help with shell shortcut jayted Linux - General 4 01-04-2007 09:50 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
execute shell script in KDE Lotharster Linux - Newbie 1 11-21-2005 06:02 PM
Shell Shortcut? mikeshn Linux - General 4 10-13-2004 11:21 PM
need help with symbolic link to shell script scottsteibel Linux - Software 8 08-02-2003 11:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:49 PM.

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