Its intenteded to be be used if your using GDM.
Its my first script here in kde-apps.org.
It was tested in fedora so please read the readme file if you use other distro.
Any improvement sugestions are welcome

Source (link to git-repo or to original if based on someone elses unmodified work):
NAME CHANGE
i did change the name kshutdown for kpoweroff because there are other kshutdown before
v.0.2
I did some changes in paths that contains some error , thakns androu999
v 0.3
Changed installation paths for a generic KDE path
v 0.4
the installer has been improved , now can detect any distro D
Added some trobleshooting to readme file.
Ratings & Comments
11 Comments
Why is your readme a shell script?
The script doesn't work at the moment on my Debian box, but I think it's a great idea. I use Libranet's Debian, which defaults to GDM2 which I like very much. The big question is, does this script (when it works) trigger the kde save session? I really like coming back to the box the way I left it. Thanks!
hi, if you read some past comments you can see the script can work in debian with a litle changes.I have changed the readme file with 2 trobleshoting steps, maybe it will be helpfull to you. About save session at this moment the script cant save the session, but i will try to improve the script to do that. thanks for the sugestion. If you have troble with the script , write here that i will try to help you
Thanks for you advise, but i had to do some other changes, until the script worked. 1. chmod 4755 /sbin/poweroff (you advise!) 2. in your install.sh file, i had to change /applnk-redhat/ to /applnk/ because the else-thing doesn't work. 3. in the kpoweroff-file you need to add /sbin/ in front of poweroff though i had to do these things, your idea is great. martin
I really want to use this, but when i start the script, and select YES at the prompt, nothing happens. Do i have to be root that this works? I'm using SuSE 9.0 and KDE 3.1.4 and GDM. I hope somebody can help me. greetz Martin
Hi; I think that the problem is the /sbin/poweroff file. androu999 have discoverded that you have to do chmod 4755 /sbin/poweroff So that non-root users can use the kshutdown script. So i now know that Debian and Suse needs to chmod poweroff file, then I will update the readme and make some changes too. THanks to Chris for the chmod trick :)
It looks like there are several references to /home/juanma in the scripts that prevent this from working (i.e. paths to /home/juanma/kshutdown, /home/juanma/icons/icon.png, etc.) I'm editing them right now to see if I can get it to work anyway since the important part is the kshutdown script. BTW, great idea for a menu item; it's silly having to do sudo halt everytime I want to shut my computer down...
Just a quick addendum: I had to fix the paths as mentioned in my previous comment, then I had to setuid root on the kshutdown script and point the path to /sbin/poweroff (I'm not sure if I *had* to do that, but I did a couple of things while I was fixing it.) Also, I edited the shutdown.desktop file in ../.kde/share/applnk/shutdown.desktop and removed the generic name entries so it just says "shutdown" in my Kmenu. Anyway, it works like a charm now. Pretty cool. :]
thanks for your comments :), i´m very happy about you are using the script I will check the scripts for the /home /juanma/ references , and try to clean the code .... About /sbin/poweroff, i have fedora and the original script run fine, but i see that you are using other distro ... and think that /sbin/poweroff works well too. Thanks again :) if you want, send me your modified scripts and the name of your distro so i will ckeck it out and i will upload it too.
If you're using KDM this is already possible. When you click "Logout" it will present you with "End Session Only", "Turn off computer", and "Restart computer". If you were using GDM or XDM though, I guess this might be useful. What might make this more useful though is if you could present a restart option with boot images to select from. This is presented in KDM, but not in the logout screen.
thanks for your suggestion. Yes you are rigth about KDM, i made this script for GDM because i like GDM at the beginning of the session but i like KDE for desktop. I will update the description of the script :).