Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Run a script when KDE is started..
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Fri Jan 14, 2005 11:22 am    Post subject: Run a script when KDE is started.. Reply with quote

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
View user's profile Send private message
travisau
n00b
n00b


Joined: 06 Apr 2003
Posts: 63

PostPosted: Fri Jan 14, 2005 11:25 am    Post subject: Reply with quote

create a script in ~/.kde/

Anything inside that directory is automatically run when that user logs into kde.
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Fri Jan 14, 2005 12:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
caravela
Tux's lil' helper
Tux's lil' helper


Joined: 30 Aug 2004
Posts: 118

PostPosted: Fri Jan 14, 2005 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Shanachie
n00b
n00b


Joined: 24 May 2004
Posts: 35

PostPosted: Fri Jan 14, 2005 3:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Fri Jan 14, 2005 3:49 pm    Post subject: Reply with quote

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... :wink:
_________________
Registered Linux User #363420
Back to top
View user's profile Send private message
Olis
Apprentice
Apprentice


Joined: 29 Sep 2004
Posts: 177
Location: Germany

PostPosted: Sat Jan 15, 2005 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum