How to log out with a command in a gnome-less environment?

Posted by octosquidopus on Ask Ubuntu See other posts from Ask Ubuntu or by octosquidopus
Published on 2012-01-03T19:08:00Z Indexed on 2012/09/05 21:50 UTC
Read the original article Hit count: 245

I installed various window managers (Awesome, dwm, etc.) from which I am not able to log out back to the login screen (gnome-session) in order to switch to another window manager. I need to reboot to do that, which is a waste of time.

Question How can you log out via the terminal? didn't work..

dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.Logout uint32:1

..neither did this:

gnome-session-save --force-logout

..nor that:

gnome-session-quit --force-logout

they all returned:

Failed to call logout: The name org.gnome.SessionManager was not provided by any .service files

Is there a quick way to log out back into Gnome's session manager from a non-Gnome desktop manager using a terminal emulator? I know that CTRL+ALT+BACKSPACE can be configured to restart X, but I'm looking for the easiest way to log out.

© Ask Ubuntu or respective owner

Related posts about desktop-environments

Related posts about logout