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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-11-2005, 11:09 AM
|
#1
|
Member
Registered: Jul 2004
Location: Berlin
Distribution: fedora 3
Posts: 79
Rep:
|
execute shell-scripts at kde startup
hi,
how can i execute shell scripts when i log on to my fedora core 3 - system, i.e. when kde is started?
with applications, i just did a
ln -s /usr/bin/firefox
in the directory
~/.kde/Autostart
which works, but if i do the same with my shell-scripts, the script is not executed but opened in a text-editor when kde starts.
thx for help in advance
|
|
|
10-11-2005, 05:08 PM
|
#2
|
Member
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705
Rep:
|
In ~/.kde/Autostart, put something like this........
Code:
cd path/to/script ./<script>
OR
Code:
cd path/to/script sh script.sh
|
|
|
10-11-2005, 09:58 PM
|
#3
|
Member
Registered: Jul 2004
Location: Berlin
Distribution: fedora 3
Posts: 79
Original Poster
Rep:
|
aehhh,
how? ~/kde/Autostart is a directory and not a configfile...
should i write that to the .bashrc?
thx for help
|
|
|
10-12-2005, 12:37 AM
|
#4
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
I usually just put symlinks in the autostart directory, and that works fine. Just make sure that the file being linked to is executable, and all should be good.
Code:
jim@musicbox:~$ ls -al .kde/Autostart/
total 4
drwx------ 2 jim jim 136 2005-09-30 22:36 .
drwx------ 4 jim jim 200 2005-09-29 00:48 ..
-rw-r--r-- 1 jim jim 1605 2005-09-29 00:48 .directory
lrwxrwxrwx 1 jim jim 16 2005-09-30 22:36 konsole -> /usr/bin/konsole
lrwxrwxrwx 1 jim jim 21 2005-09-30 01:20 xscreensaver -> /usr/bin/xscreensave
Peace,
JimBass
|
|
|
10-18-2005, 06:03 PM
|
#5
|
Member
Registered: Jun 2004
Posts: 33
Rep:
|
Alright I have done this on my system to a script located in /usr/bin but it still opens it up in a text editor.
|
|
|
10-18-2005, 08:38 PM
|
#6
|
Senior Member
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100
Rep:
|
Could be any type of problem. Here are the 2 that I think are the most likely.
1) Is it executable? Most things in /usr/bin are, but if you put this there yourself, it may just have read, or read/write permissions. you can find out with
Code:
ls -al /usr/bin/(scriptname)
I won't go into how to interpret the info you get back in detail, but doing searches on permissions can help you. If you want this to be run, then most likely each possibile user (owner, group, and others) should have the ability to execute it. Another easy way to test:
Code:
/usr/bin/(scriptname)
If that executes the script, than permissions are most likely fine. If it doesn't execute, then your permissions are screwed up. That isn't 100% accurate, but is quick and easy.
2) Do you have the extension (if the script has one) associated with something else? I have seen Fedora Core boxes where when you try to download .rpm files, real player tries to play the .rpm as an audio file. If your script has some extension (.cgi, .exe, .*) you should check into that possibility.
Peace,
JimBass
|
|
|
10-19-2005, 09:39 AM
|
#7
|
Member
Registered: Jun 2004
Posts: 33
Rep:
|
The permissions are -rwxrwxr-x.
One thing about this script is that when I view it in Nautilus it shows up as a text file not a script. How can it be changed from a text file to a script file?
|
|
|
10-19-2005, 10:15 AM
|
#8
|
Member
Registered: Jun 2004
Posts: 33
Rep:
|
I have renamed the script to include a <.sh> on the end. Now the system sees it as a shell script but it still opens it up with a text editor.
|
|
|
10-23-2005, 02:07 PM
|
#9
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Create a New -> "link to application" in the KDE context menu. Then select properties and change the name, set the working directory, and enter the script name in the execute dialog. Or press "browse" and find it that way. The main point is that there should be a <script-name>.desktop in the ~/.kde/Autostart/ directory, rather than a file link.
|
|
|
10-23-2005, 02:34 PM
|
#10
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Rep:
|
I don't use KDE, but couldn't you put something like "/path/to/script &" above the line to start KDE in your ~/.xinitrc?
|
|
|
10-28-2005, 11:47 AM
|
#11
|
LQ Newbie
Registered: Oct 2005
Posts: 1
Rep:
|
Hi, my answer to your question is:
ad the following line to your script:#!/bin/bash
so that it will look like this:
#!/bin/bash
your commands...
and as it was said, make it executable...
I hope this solves your problems, if you have not already solved them!
|
|
|
All times are GMT -5. The time now is 07:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|