Command line to log out without displaying a confirmation dialog

Please post all general support questions for LXDE here.
Post Reply
fischerjd
Posts: 1
Joined: Thu Sep 29, 2022 5:02 am

Command line to log out without displaying a confirmation dialog

Post by fischerjd »

Is there a command line that logs a user out without first displaying the logout confirmation dialog?

I'm aware of these commands,

* lxde-logout
* lxsession-logout

but (a) both of these programs display a logout confirmation dialog, and (b) these programs' manual pages don't provide (or don't document) an option that disables/bypasses the logout confirmation dialog.

As a software developer, I sometimes need to repeatedly log out and log back in to test changes to software (e.g., login scripts, logout scripts), and I'd like to be able to log out without having to go through the logout confirmation dialog: it's an unwanted and unneeded extra step for me.

Ultimately, I'd like to create an XDG desktop file that places a "Logout" icon on the user's desktop. Clicking on the desktop iconlogs out the user without displaying the confirmation dialog.

(NB: I know how to create the desktop file. What I don't know is the command line I should use to end the current login session without displaying a logout confirmation dialog.)
edward
Posts: 146
Joined: Mon Sep 22, 2008 11:01 pm
Location: Boston

Re: Command line to log out without displaying a confirmation dialog

Post by edward »

Hi. Welcome to the forum.

Have you tried logout now? I have tried the command shutdown now, which works with other desktops, but haven't tried it with LXDE.
Debian Sid - LXDE
herrylauu
Posts: 2
Joined: Sat May 20, 2023 1:07 am

Re: Command line to log out without displaying a confirmation dialog

Post by herrylauu »

The command to log out without displaying a confirmation dialog depends on the operating system you are using.
stumble guys
jameswaller
Posts: 1
Joined: Mon Sep 18, 2023 2:48 am

Re: Command line to log out without displaying a confirmation dialog

Post by jameswaller »

edward wrote: Fri Oct 28, 2022 12:25 am Hi. Welcome to the forum.

Have you tried logout now? I have tried the command shutdown now, which works with other desktops, but haven't tried it with LXDE geometry dash lite
I tried the method you mentioned but it didn't work. The situation I encountered is similar to the situation the thread owner is experiencing
annakena
Posts: 1
Joined: Wed Mar 06, 2024 1:52 am

Re: Command line to log out without displaying a confirmation dialog

Post by annakena »

To log out without displaying a confirmation dialog, you can use the following command:
bash
Copy
gnome-session-quit --no-prompt rice purity
This command will log out the user without showing a confirmation dialog. You can incorporate this into your XDG desktop file to create a "Logout" icon for easy access.
rumelu
Posts: 3
Joined: Thu Dec 14, 2023 4:17 am

Re: Command line to log out without displaying a confirmation dialog

Post by rumelu »

It is necessary for me to respond to the "Are you sure..." inquiry whenever I log out of a Gnome session. This is accomplished by clicking on the "power" button located in the top panel and selecting the "Log out..." option. How can I set up my system so that I don't have to answer this question?

Due to the fact that I have already completed two actions (clicking on the panel button and selecting the "Log out" item), it is highly likely that I am in fact interested in logging out.
Post Reply