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

Wednesday, June 25th 2008, 7:52pm

How do I run a script at KDE logout?

How do I run a bash script at the start of the KDE logout process?

The reason I'm asking is that I've got a situation where the logout process is very slow, taking about 30 seconds. It appears to be due to the services klaptop and knemo taking a long time to unload, for some reason. If I manually run the following commands which unload these services *before* logout, then the logout is swift:

dcop kded kded unloadModule "knemod"
dcop kded kded unloadModule "klaptopdaemon"

Unfortunately, if I put those commands in the ~.kde/logout directory, I've found with some testing that they don't run until about 30 seconds later, showing that the content of the logout directory is not run until *after* this annoying delay.

So is there a way to run a script at (or soon after) the *start* of the KDE shutdown process, rather than after it has completed?

(I'm running KDE 3.5.9, as supplied with Mandriva 2008.1)

2

Monday, June 30th 2008, 8:06pm

I got a good answer on another forum, so I'll mention it here.

Put a bash shutdown script into a file, chmod a+x the file, create an applet on the desktop that runs the script, add the stop button icon to it, drag that applet onto the task bar to the right of the menu button, and click on it to logout ...

The apps that need to be closed to ensure a logout that doesn't jam for 20 seconds seem to vary for me, so I'm now shutting down kmix, klaptop and knemo. I think it's some oddity of the sound driver on my system. So the complete logout script is now:

#! /bin/bash
dcop kded kded unloadModule "knemod"
dcop kded kded unloadModule "klaptopdaemon"
dcop kmix MainApplication-Interface quit
dcop kdesktop default logout

Similar threads