LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-11-2005, 11:09 AM   #1
supersucker
Member
 
Registered: Jul 2004
Location: Berlin
Distribution: fedora 3
Posts: 79

Rep: Reputation: 15
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
 
Old 10-11-2005, 05:08 PM   #2
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
In ~/.kde/Autostart, put something like this........
Code:
cd path/to/script ./<script>
OR
Code:
cd path/to/script sh script.sh
 
Old 10-11-2005, 09:58 PM   #3
supersucker
Member
 
Registered: Jul 2004
Location: Berlin
Distribution: fedora 3
Posts: 79

Original Poster
Rep: Reputation: 15
aehhh,

how? ~/kde/Autostart is a directory and not a configfile...

should i write that to the .bashrc?

thx for help
 
Old 10-12-2005, 12:37 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 10-18-2005, 06:03 PM   #5
BlackJackal
Member
 
Registered: Jun 2004
Posts: 33

Rep: Reputation: 15
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.
 
Old 10-18-2005, 08:38 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 10-19-2005, 09:39 AM   #7
BlackJackal
Member
 
Registered: Jun 2004
Posts: 33

Rep: Reputation: 15
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?
 
Old 10-19-2005, 10:15 AM   #8
BlackJackal
Member
 
Registered: Jun 2004
Posts: 33

Rep: Reputation: 15
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.
 
Old 10-23-2005, 02:07 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
 
Old 10-23-2005, 02:34 PM   #10
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
I don't use KDE, but couldn't you put something like "/path/to/script &" above the line to start KDE in your ~/.xinitrc?
 
Old 10-28-2005, 11:47 AM   #11
etn
LQ Newbie
 
Registered: Oct 2005
Posts: 1

Rep: Reputation: 0
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!
 
  


Reply


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
Implications when giving out a shell account to execute halflife server scripts nistelrooy Linux - General 4 02-24-2006 01:00 AM
Execute Shell Scripts on startup dragoroberto Linux - Software 9 02-28-2005 09:46 AM
Startup scripts not bothering to execute... systemparadox Slackware 3 01-26-2005 01:56 PM
how to execute shell scripts from cgi script rajatgarg Linux - General 1 07-08-2004 02:39 PM
How to get Konqueror to execute shell scripts in a new console on double click nitrambass Mandriva 0 06-22-2004 11:38 AM


All times are GMT -5. The time now is 03:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration