LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 02-10-2006, 08:49 AM   #1
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Rep: Reputation: 16
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.
 
Old 02-10-2006, 08:55 AM   #2
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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).
 
Old 02-10-2006, 09:14 AM   #3
handu
LQ Newbie
 
Registered: Aug 2005
Posts: 14

Rep: Reputation: 0
Or just write a script with "shutdown -h now" command!
There are few ways to do this.
 
Old 02-10-2006, 09:31 AM   #4
amosf
Senior Member
 
Registered: Jun 2004
Location: Australia
Distribution: Mandriva/Slack - KDE
Posts: 1,672

Rep: Reputation: 46
If you use autologin (in suse or mandriva) and the logout applet on the taskbar, then it is indeed a two click shutdown...
 
Old 02-10-2006, 11:00 AM   #5
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 863

Rep: Reputation: 45
Try going to Control Centre, KDE Components, Session Manager. There should be a checkable box for "offer Shutdown Options"

I'm not sure if this only works for KDM or not. If you don't have the checkbox, in a shell issue:

Code:
david@davcefai:~$ ps -A|grep dm
 4236 ?        00:00:00 kdm
 4270 ?        00:00:00 kdm
david@davcefai:~$
The result will be xdm, gdm or kdm (as in my case).

To change it, check what your default run level is (look in /etc/inittab). Then use SysV-init Editor to change it.

Result: A 2-click shutdown of a system that doesn't know about blue screens.
 
Old 02-10-2006, 08:49 PM   #6
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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.
 
Old 02-10-2006, 10:40 PM   #7
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 16
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.
 
Old 02-11-2006, 12:00 AM   #8
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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.
 
Old 02-11-2006, 12:29 AM   #9
davcefai
Member
 
Registered: Dec 2004
Location: Malta
Distribution: Debian Sid
Posts: 863

Rep: Reputation: 45
Quote:
So how cool is it to be from Malta?
At the moment, pretty cool Warming up from 8 deg C which we consider bitterly cold.

Your ps -A|grep dm shows that you are running gdm. So what you want to do probably only works on kdm (the KDE desktop manager).

So you want to replace gdm by kdm, which you can easily do in SysV-Init editor.

Won't go into detail here unless you ask.
 
Old 02-11-2006, 12:53 AM   #10
anindyanuri
Member
 
Registered: Jan 2005
Location: India
Distribution: Kubuntu Gutsy
Posts: 450

Rep: Reputation: 30
We are probably going detrack.

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

regards
 
Old 02-11-2006, 09:48 AM   #11
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 16
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.
 
Old 02-11-2006, 02:45 PM   #12
GrueMaster
Member
 
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
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.
 
Old 02-14-2006, 11:45 PM   #13
drakebasher
Member
 
Registered: Aug 2004
Location: Proprio Qui
Distribution: Debian
Posts: 85

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by GrueMaster
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE Shutdown click ? waelaltaqi Linux - General 7 01-13-2006 05:02 PM
Kdm will not let me log out or shutdown J_Szucs Linux - General 3 05-27-2005 10:00 AM
Log Out and Shutdown Shortcut Boffy Linux - Newbie 1 07-27-2004 09:06 PM
where is log for shutdown xkwauk Linux - Software 2 05-28-2004 07:18 PM
where is the shutdown log? hamish Red Hat 4 09-28-2003 05:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration