You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, March 21st 2006, 3:41pm

Shutdown

I need to stop certain programs when I log out of KDE, so I have included a script in ~.kde/shutdown, which, when executed, kills the necessary processes.

Problem is, the script is not executed when I log out.

From what I have read, it should be. Anyone?

Mandrake 10.1, KDE 3.2

Andrew

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Saturday, April 1st 2006, 3:18pm

Not sure if this is already in KDE3.2

Check the startkde script it does this at the end

Source code

1
2
3
4
5
6
7
8
echo 'startkde: Running shutdown scripts...'  1>&2

# Run scripts found in $KDEDIRS/shutdown
for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/shutdown/,p'`; do
  for file in `ls "$prefix" 2> /dev/null | egrep -v '(~|\.bak)$'`; do
    test -x "$prefix$file" && "$prefix$file"
  done
done


Cheers,
_
Qt/KDE Developer
Debian User

eetbeest

Beginner

Posts: 30

Location: Europe

  • Send private message

3

Tuesday, April 4th 2006, 1:46pm

RE: Shutdown

Quoted

Originally posted by fdservices
I need to stop certain programs when I log out of KDE, so I have included a script in ~.kde/shutdown, which, when executed, kills the necessary processes.


A very different approach would be to stick the killing in .xsession or .xinitrc instead. Assuming those are run, which not every distro / kdm installation does.

From the code Anda posted, I don't see that .kde/shutdown/ is included in the execution (does KDEDIRS include ~/.kde ?)

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

4

Thursday, April 6th 2006, 11:02pm

the local prefix, i.e. .kde/ is part of $exepath

$exepath is the list from

kde-config --path exe

The code at the end of startkde just replaces the "bin" part with "shutdown"

Cheers,
_
Qt/KDE Developer
Debian User

5

Sunday, April 9th 2006, 10:25am

Yes, I found the code in startkde, but I did not understand why that should be executed when KDE is shut down. Is startkde also the "stopkde" script? Sounds a bit Bill Gates to me :).

I will have to check again that the codematches you example, but it definitely does not execute when I Log Out and Shut Down.

Can you explain exactly why and when it is called?

Many Thanks

All the best


Andrew

bram85

Professional

Posts: 948

Location: Eindhoven

Occupation: Software Engineer

  • Send private message

6

Sunday, April 9th 2006, 10:45am

startkde is a script which always runs in the background when you're in KDE. So yes, it takes care of starting and shuttind down KDE.
Bram Schoenmakers
KDE Netherlands (www.kde.nl)