PC turn off if I close the lid after login

I have a laptop with an external monitor.

When I boot up, at a certain point GNOME prompt for user account password on external screen only.

At this point, if I put the password in, press enter, and then immediately close the lid, the PC turn off.

If instead I wait for the desktop to appear (i.e., for the wallpaper to appear), it won’t turn off and it works correctly.

But sometimes I forget I have to wait :frowning:

How can I prevent it from turning off?

If you done it with gnome, then it is not ready immediately after log in to it.
I bet you need to do it with a command line tool who takes effect before the login screen appears.

Can you please give us a inxi -Fzx to see with what hardware you are dealing?

You may want to look at /etc/systemd/logind.conf

You may also want to set the primary screen to be the external display if you have not already.

Can you please give us a inxi -Fzx to see with what hardware you are dealing?

No. That contains much more information than what I’m comfortable sharing in the wide.

I don’t know how to do that.

In Settings → Display I only see the external monitor. And I can’t deactivate it.

Just to make sure things are clear:
You have a laptop with an external monitor hooked up to it running fedora workstation.
You power on the laptop
- At this point the laptop lid is open, and everything is displayed on the external monitor.
- The login screen comes up on the external monitor. You than log in and then shut the lid on the laptop. If you wait long enough for the desktop to come up it does not shut off.

If you look at /etc/systemd/logind.conf

You’ll probably want to change one or both of the top two to ignore.

1 Like