View previous topic :: View next topic |
Author |
Message |
vdboor Guru
Joined: 03 Dec 2003 Posts: 592 Location: The Netherlands
|
Posted: Fri Jan 14, 2005 11:22 am Post subject: Run a script when KDE is started.. |
|
|
I'd like to know how to run a script when KDE is started.
To be precise, this is what I want to accomplish:
Code: | renice -20 `pidof X`
renice -20 `pidof kwin`
renice -20 `pidof kicker` |
As you might know, this also requires root privileges. _________________ The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ] |
|
Back to top |
|
|
travisau n00b
Joined: 06 Apr 2003 Posts: 63
|
Posted: Fri Jan 14, 2005 11:25 am Post subject: |
|
|
create a script in ~/.kde/
Anything inside that directory is automatically run when that user logs into kde. |
|
Back to top |
|
|
vdboor Guru
Joined: 03 Dec 2003 Posts: 592 Location: The Netherlands
|
Posted: Fri Jan 14, 2005 12:26 pm Post subject: |
|
|
Thanks
I've created a script in ~/.kde/Autostart/ instead, it appears to be started once really everything is run. (also used sudo to run the script as root, and made sure normal users can't edit it.. ) _________________ The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ] |
|
Back to top |
|
|
caravela Tux's lil' helper
Joined: 30 Aug 2004 Posts: 118
|
Posted: Fri Jan 14, 2005 1:45 pm Post subject: |
|
|
for everyone to run it you should put it in /usr/kde/x.x/share/autostart/ not in the home folder of a user .... |
|
Back to top |
|
|
Shanachie n00b
Joined: 24 May 2004 Posts: 35
|
Posted: Fri Jan 14, 2005 3:29 pm Post subject: |
|
|
There's another way to run scripts for a specific user.
Any script in $HOMEDIR/.kde/env/ is excecuted when the user log in.
I use it to run gpg-agent. |
|
Back to top |
|
|
bennettp Guru
Joined: 22 Feb 2004 Posts: 335 Location: on my back and tumbling
|
Posted: Fri Jan 14, 2005 3:49 pm Post subject: |
|
|
one tip: it might be worth putting a "sleep" at the beginning of the script so that X, kwin, and kicker have enough time to start up before the script is run.
...also, don't you think -20 is a bit excessive? AFAIK, the scale doesn't go any lower than -19... _________________ Registered Linux User #363420 |
|
Back to top |
|
|
Olis Apprentice
Joined: 29 Sep 2004 Posts: 177 Location: Germany
|
Posted: Sat Jan 15, 2005 5:31 pm Post subject: |
|
|
Shanachie wrote: | There's another way to run scripts for a specific user.
Any script in $HOMEDIR/.kde/env/ is excecuted when the user log in.
I use it to run gpg-agent. |
Hm, you should already have such a script in /usr/kde/3.3/env:
oliver@sam env $ ll /usr/kde/3.3/env
-rw-r--r-- 1 root root 201 1. Jan 18:17 agent-startup.sh
Code: | #!/bin/sh
#
# Customized agents startup file
#
if [ -x /usr/bin/gpg-agent ]; then
eval "$(/usr/bin/gpg-agent --daemon)"
fi
if [ -x /usr/bin/ssh-agent ]; then
eval "$(/usr/bin/ssh-agent -s)"
fi |
Oliver |
|
Back to top |
|
|
|