7

I use Ubuntu 18.04.3 gnome laptop with a second monitor connected with HDMI. If I close the lid of my laptop it successfully locks (after I reopen it I have to type my password) but the windows opened on my second screen stay in place. I mean they can be seen after the lid is closed. I want them to go away in that situation (the second screen must go black), how do I do that?

1
  • I wasn't able to reproduce your problem (on ubuntu 20.04), when i have a second screen attached the action of closing the lid doesn't lock my laptop, but instead moves all windows on the second monitor. Anyway have you tried playing with gnome tweaks (download from store)? there is a workspace section there, it might help you enabling the option "workspaces span displays".
    – Niccco
    Jul 2, 2020 at 18:32

2 Answers 2

0

If you change the primary display to your Built-In display, it does it automatically. I use a tv as a second monitor and this seemed to work for me. The tv only went blank but did not turn off.

Screen Display Menu

1
  • Doesn't work for me
    – reflex0810
    Jul 2, 2020 at 20:34
0

If you don't mind a slightly longer startup time, you can set your laptop to hibernate rather than suspend when you close the lid. If you want to try this, you can follow the directions on this article - https://tipsonubuntu.com/2018/04/28/change-lid-close-action-ubuntu-18-04-lts/. I've copied them below.

First, open the terminal and run:

sudo gedit /etc/systemd/logind.conf

In the configuration file that opens up, there should be a line that reads:

#HandleLidSwitch=suspend

You want to change that to:

HandleLidSwitch=hibernate

(Remove the "#" and replace "suspend" with "hibernate")

Afterwards, save the configuration file. For the changes to take effect, go back to your terminal window and run:

systemctl restart systemd-logind.service

Your laptop should then hibernate rather than suspend when you close the lid, and it shouldn't be able to output any image while hibernating.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .