![]() Registered Member ![]()
|
I want to run a script when the user clicks the shutdown button in KDE4. If I put the entry into the ~/.kde/shutdown folder then it only runs AFTER the shutdown process has started, and KDE has closed. I would like to run the script before KDE exists, so that I can abort the KDE exit from the script. Adding it to the:
gives me the same problem. My script simply calls:
to abort shutdown if necessary. Does anyone know how to abort the shutdown before KDE exits? |
![]() Manager ![]()
|
couldn't you supersede the shutdown command called from kmenu with a script you wrote? if this script was early in the $PATH searched than it would be executed, of course then all calls to the "shutdown" (assuming it's whats being called) command would be also superseded and you would need to handle all possible variations.
caveat - not being a dev I could be totally wrong about this and it could just be dumb |
![]() Registered Member ![]()
|
Thanks for the reply, but I am not sure how to do that. I have been using Linux for a while, but I have never had to modify it's internal code before. I don't mind doing so though.
|
![]() Administrator ![]()
|
Note that KDE uses communication with KDM/ConsoleKit to enact the shutdown of the system, rather than directly invoking any shutdown commands itself.
What is the exact purpose of this script?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
This is the script, the purpose of which is to offer an abort option during the shutdown process if the backup-manager process is running, and the user has pressed the shutdown button in the KDE menu:
|
![]() Administrator ![]()
|
I would suggest using the X Session Management Protocol (XSMP) to communicate with the KDE Session Manager. Applications can request that the session not exit if needed as part of this protocol.
See http://www.xfree86.org/current/xsmp.pdf and http://en.wikipedia.org/wiki/X_session_manager
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]