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
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.