1

I want to automatically log out of the GUI session after booting the PC because a program I use doesn't run unless I log out and log in again.

I wrote a crontab with this command:

@reboot gnome-session-quit --logout --no-prompt 

But it is not working.

0

1 Answer 1

0

Create a systemd service and add this to the [Service] section:

[Service]

Exec=gnome-session-quit --logout --no-prompt

How to start a systemd service after user login and stop it before user logout

How create a service in linux that can handle queries?

gnome-session-quit

Or you can also try the following, which probably won't work:.

@reboot sleep 60 && gnome-session-quit --logout --no-prompt 

This might help to wait 60 sec, if the session isn't fully loaded when the system starts, and the logout command might not work immediately for that reason.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.