Debian – command to log out of LXDE directly

debianlogoutlxdeopenbox

To log out of LXDE, I can click on the "Start" menu, click "Logout" and when the menu pops up click on "logout" again.

Or I can type lxde-logout in my terminal and when the menu opens, click on "logout".

Both options are too cumbersome. I need a command which will log me out immediately, without menu, or without other options.

Is this possible ?

I am using LXDE on Debian Wheezy

Best Answer

I think you can just run this command to log out.

$ pkill -SIGTERM -f lxsession

Also if you go poking through the LXDE GitHub page there's a section at the end of this URL: https://github.com/lxde/lxsession.

Excerpt

==== Log out ===

Simply executing this command:

  lxsession-logout

This will give you a good-looking logout dialog. If gdm is installed, lxsession can do shutdown/reboot/suspend via gdm. (These options are not available if gdm is not running.)

If you want to customize this logout box further, try this:

  lxsession-logout --prompt "Your custom message" --banner "Your logo" \
    --side "left | top | right | bottom (The position of the logo)"

We create a script /usr/bin/lxde-logout to do this:

  #!/bin/sh 

  /usr/bin/lxsession-logout --banner \
      "/usr/share/lxde/images/logout-banner.png" --side top

You can put this logout script in the menu of your window manager or desktop panel. Then, you can logout via clicking from the menu.

References

Related Question