Log out of X and shutdown with one (or two) click?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Log out of X and shutdown with one (or two) click?
To shutdown the system from X, running KDE, the default requires to first click "logout" and then *wait* for the gdm login screen and then <action><shutdown><Halt>. I'd like to add a main menu item that with one click and maybe another for confirmation, the user will be logged out of X normally and then the system will shutdown.
(I gotta say, this is for my wife who might rather be on another OS, so I want to make things easy for her)
Mostly, I need to know what command will logout the user from X in a normal manner and then I could simply add the shutdown command to that after adding the user to the shutdown group. I'm sure this has been done before.
You could just add the Lock/Logout applet to the taskbar. It will save going to the start menu at least. Besides, shutting down linux is no harder than shutting down Windows. And it's actually quicker in some cases (it takes my wife's laptop 5 minutes to shut down).
One other thing that she could do, that works quite well with most of the newer distros and newer (PII or better) systems. Just tap the power button on the front of the system. Linux will sense this and automatically startthe powerdown sequence.
Cool that I got 5 responses. Thanks, guys. Gruemaster: The Lock/Logout applet looks promising, but I can't seem to get it to shutdown the system without sending me to the gdm login screen. Is there a trick? handu: Nice try, but that loses any configuration settings from the session. May as well just pull the plug: and yes, there are many ways to do that. Thanks for the reply. amosf: (un)fortunately, I'm in Debian and not Suse or Mandriv... So what is "logout applet": Do I need to install a package, or could you share the properties of that applet? davcefai: I checked the "offer shutdown options" (and then "Apply"), but it just sent me to the same gdm login screen. I didn't follow you after the 'grep' part. what would I do with that? 1348 ? 00:00:00 gdm 1358 ? 00:00:00 gdm So how cool is it to be from Malta? Gruemaster: Doesn't happen. I'm sure it's something that could be set up in configuration files, but it's not there yet. Would you know what files come into play? Again, thanks all for replying.
Last edited by drakebasher; 02-10-2006 at 10:45 PM.
I'm not as of yet experienced with debian (but I'm learning at work). I know what changes to make in Mandriva under KDE (Suse should be the same). I do know that there are a lot of configuration settings in Debian that disallow user shutdown/reboot by default.
The logout applet is part of KDE (although I'm sure Gnome has one as well). If this machine is her's exclusively, I'd recommend starting her out on a simpler distro, like Mandriva or Suse. Nothing against Debian, but it is designed to be more of a hands on distro. Lots of developers use it for this reason. But she would have an easier time with a more novice friendly distro.
My respected darkebasher, if you use GDM, you can pretty well bring the required 'GNOME Logout Applet' by right clicking of your mouse over the panel-->Add to panel-->Log out
davcefai and anindyanuri: For the default, the CDs that I installed from install both Gnome and KDE. The login screen is run by GDM, but I choose to run KDE. So I don't have a 'GNOME Logout Applet' which is probably what I want, since I know on my Fedora system (Gnome), I can shutdown without first logging out.
So I think we're back to my first question: how to exit KDE *normally* from the command line? By normally, I mean the way KDE saves settings, etc, as opposed to just doing 'shutdown -h now' which will not. If I knew the command for exiting KDE normally, I would simply make an applet to run a shutdown script.
Kde has a lock/logout applet that can be installed on the taskbar. Right click on the taskbar, select "add to panel->applet->lock/logout applet".
As to allowing her to shutdown, it would be easier if you were using kdm (since you are using kde). It can be configured with the kde control center to allow users to shutdown the system. You could probably configure gdm through the gconf-editor, but I don't know.
As to allowing her to shutdown, it would be easier if you were using kdm (since you are using kde).
That's right, and that's the way I want to go. I did apt-get install kdm and got the packages needed. I deleted the gdm link from /etc/init.d/rc5.d (what I boot to), but when I reboot, it says "Not starting K Display manager (kdm); it is not the default display manager." So where do I set kdm as the default display manager? I can start kdm manually, no problem, but I want it to start automatically. Thanks~
I've got it now: I edited /etc/X11/default-display-manager to make it work, so it now comes up with KDM login screen and the logout dialog has an option for shutdown
Thanks, guys.
Last edited by drakebasher; 02-15-2006 at 12:09 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.