Registered Member
|
Hello,
I'd like to run a logoff script when KDE shuts down. I there a method to do this? I do NOT want that this logoff script runs on every user logoff. This script should run only when KDE is turned off. I have searced the tech base but I have not found what I am looking for - may be someone of the experts can help? Thanks a lot Michael
Last edited by bushveld on Sat Jan 10, 2009 8:23 pm, edited 1 time in total.
openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
|
Administrator
|
To KDE there is no difference between System Shutdown and User Logoff. the only difference is if the call made to KDM to perform a shutdown.
If the script does not require a graphical system, then you could add it to the list of commands for init to execute when the system begins to shutdown. If it requires a graphical system, then you will need to discover how to find out what type of KDE shutdown ( system shutdown or standard logoff ) is being performed and act appropriately in a script that always executes on user logoff.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thanks
in kde3 there was a directory /opt/kde/share/shutdown is there something similar with kde4? (I am not sure about the (share), sorry have no more a kde3 system at hand. Michael
openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
|
Administrator
|
From what I can find in the documentation, KDE 4 only executes *.desktop files, or scripts that are placed in the appropriate folders in $KDEHOME ( normally ~/.kde4 ) There is no system wide KDE shutdown scripts directory.
However, a complicated workaround should be possible, by making options immutable, custom scripts, etc. The appropriate folders are "Autostart" and "shutdown" the contents of which can be managed with the "Autostart" control module is the advanced tab of system settings.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
KDE Developer
|
Yes, same mechanism in KDE4 Executables in KDEDIRS/shutdown are executed at the end of the startkde script. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
I've found this doesn't mean what I expected it to mean. On openSUSE running KDE 4.1.3 there exists /usr/share/kde4/ and /etc/kde4/ so I would expect to be able to place a script in /usr/share/kde4/shutdown or /etc/kde4/shutdown and have that script run when a user logs out. However that doesn't work. By adding a line in to /usr/bin/startkde and having it print out a list of the dirs it's looking for shutdown scripts in I found the output to be /home/mike/.kde4/shutdown/ /usr/shutdown/ A script placed in /usr/shutdown does get run when a user logs out. It seems completely illogical that KDE looks in /usr/shutdown and not /usr/share/kde4/shutdown or /etc/kde4/shutdown |
Administrator
|
/usr/shutdown is likely a XDG location in case you are wondering.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]