How to run a script automatically at KDE startup?

Everything about X, Gnome, KDE, ... and everything running on it

How to run a script automatically at KDE startup?

Postby hkoster1 » 2007-03-17 09:17

My keyboard needs modifications that I've put in a script, to be run automatically at startup. Now, in Gnome I would put this in Preferences -> Sessions -> Startup Programs, but in KDE I've searched in vain for a similar place. My fault entirely, of course, not looking in the right spot... Could anyone give me a pointer?
hkoster1
 
Posts: 1265
Joined: 2006-12-18 10:10

Postby thamarok » 2007-03-17 10:02

~/.kde/Autostart/
thamarok
 
Posts: 1798
Joined: 2006-10-12 16:36

Postby hkoster1 » 2007-03-17 10:49

thamarok wrote:~/.kde/Autostart/

Right, it's easy once you know it... Thanks.
hkoster1
 
Posts: 1265
Joined: 2006-12-18 10:10

Postby hkoster1 » 2007-03-17 18:49

Well, putting a script in ~/.kde/Autostart works well for user programmes, but I also need to run another script with root privileges (I need to make sure that some firmware is loaded BEFORE a driver is loaded with modprobe). Does anyone know how to do that in KDE?
hkoster1
 
Posts: 1265
Joined: 2006-12-18 10:10

Postby thamarok » 2007-03-17 20:12

Can't you run it before starting KDE?
/etc/rc.local ?
thamarok
 
Posts: 1798
Joined: 2006-10-12 16:36

Postby hkoster1 » 2007-03-17 21:51

thamarok wrote:Can't you run it before starting KDE?
/etc/rc.local ?

Right, that does the job! You've been very helpful. :D
hkoster1
 
Posts: 1265
Joined: 2006-12-18 10:10

Postby thamarok » 2007-03-17 22:44

No problem :P
As long as I can help people out then I feel happy :)
thamarok
 
Posts: 1798
Joined: 2006-10-12 16:36

Postby jongi » 2007-05-18 18:16

thamarok wrote:Can't you run it before starting KDE?
/etc/rc.local ?


Ah just the thing I need to run a script at startup that would be up and running when KDE starts
jongi
 
Posts: 477
Joined: 2007-04-15 02:41

Postby jongi » 2007-05-21 20:22

It seems /etc/rc.local is no longer being run at boot. what would cause this?
jongi
 
Posts: 477
Joined: 2007-04-15 02:41

Postby thamarok » 2007-05-22 12:59

jongi wrote:It seems /etc/rc.local is no longer being run at boot. what would cause this?
Don't know, but my Debian seems to run it only sometimes when I boot my system.. However, I discovered, that if you want to run a script/application when KDE starts, you can use this:
echo 'exec /usr/bin/myscript' >> ~/.xinitrc

Just replace /usr/bin/myscript with the application you want to autostart when KDE starts.
thamarok
 
Posts: 1798
Joined: 2006-10-12 16:36

Postby chrismortimore » 2007-05-22 13:02

Mine still runs /etc/rc.local on boot.

You could put this into ~/.kde/Autostart/ and configure sudo appropriately if you wish:
Code: Select all
#!/bin/bash
sudo /path/to/your/script/
Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 5x320GB WD 7200rpm Caviar RE2 (RAID5), Nvidia 6600GT 256MB
Laptop: Intel Pentium M 1.5GHz, 512MB PC2700, 60GB 5400rpm IBM TravelStar, Nvidia 5200Go 64MB
User avatar
chrismortimore
 
Posts: 862
Joined: 2007-04-24 06:34
Location: Edinburgh, UK

Postby thamarok » 2007-05-22 13:11

chrismortimore wrote:Mine still runs /etc/rc.local on boot.

You could put this into ~/.kde/Autostart/ and configure sudo appropriately if you wish:
Code: Select all
#!/bin/bash
sudo /path/to/your/script/
Or instead of sudo, use kdesu :)
thamarok
 
Posts: 1798
Joined: 2006-10-12 16:36

Postby canci » 2007-05-22 13:36

None of this is really effective, cuz you always need to type your password,
that is unless you configured sudo to never ask for one. Since this is a risk you should
consider running things before X starts, since drivers don't need it anyway.
This is a tid more complicated though, but belive me, once you get the hang of it
you will thank me. Or not :D That is why I suggest you take a look at this nice howto which tells you
about runlevels (the stages in which services and programs are run at startup):
http://www.debian-administration.org/articles/212

Then I would also suggest you install this nifty li'l tool which will make your life a lot easier:
Code: Select all
sudo apt-get install sysv-rc-conf


It's a li'l script that enables/disables things run at startup.
Take a look at this li'l howto which deals with making your Linux startup time shorter
while using the beforementioned tool. It helped me a lot! It is for Ubuntu, but the startup really
is the same as in Debian.
http://ubuntuforums.org/showthread.php?t=89491

G'luck!
I ken hez kinvulf beck? I ken hez riesnible modereyshn? Kthnxbai!

No need to discuss this topic? Offended by this signature? Remove it:

Mez wrote:You can easily just disable viewing signatures

Click here - and set "Display Signatures" to No
User avatar
canci
 
Posts: 1705
Joined: 2006-09-24 11:28
Location: Bosnia & Herzegovina

Postby jombeewoof » 2007-05-23 00:22

what if you added it to /etc/init.d/
that's where I stick my script that I need loaded before X starts up.
Mine doesn't require root though.
jombeewoof
 
Posts: 42
Joined: 2005-06-24 18:54

Postby canci » 2007-05-23 10:59

jombeewoof wrote:what if you added it to /etc/init.d/
that's where I stick my script that I need loaded before X starts up.
Mine doesn't require root though.

You still need to put a symlink into one of the runlevel directories...
I ken hez kinvulf beck? I ken hez riesnible modereyshn? Kthnxbai!

No need to discuss this topic? Offended by this signature? Remove it:

Mez wrote:You can easily just disable viewing signatures

Click here - and set "Display Signatures" to No
User avatar
canci
 
Posts: 1705
Joined: 2006-09-24 11:28
Location: Bosnia & Herzegovina


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable