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)