Shutdown computer from X session as a user

From Arch Wiki

Start your X session by prepending ck-launch-session to your session-start line in ~/.xinitrc

exec ck-launch-session startxfce4

Note that if you are using a display manager (KDM, GDM..) PolicyKit/ConsoleKit will be utilized automatically.

The computer can now be shut down with:

dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop

and restarted with:

dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

and suspended with:

dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend

Note

This doesn't work when using consolekit >0.4.1 and starting X with startx or xdm (using gdm/kdm still seems to work).

To fix this add

session optional        pam_loginuid.so

to /etc/pam.d/common-session after the last “required” line.

 
Back to top
configuration/usershutdown.txt · Last modified: 2011/08/27 21:09 by haary
 
 
GNU Free Documentation License 1.3
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0