Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
"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.
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?
"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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.