0

I use a laptop running ubuntu 20.04.

I usually have an additional display connected to the laptop, extending the monitor between the two of them. But I would like that, when I close the laptop lid, it would reconfigure the layout to not extend to the laptop and use only the external display, in the same way that disconnecting the external display pushes everything to the laptop.

Is that possible?

metichi
  • 897
  • Edit question with computer make and model to get a better answer. Should be able to do it with display settings or one of laptop's function buttons. Have mirror display off. – crip659 Jul 01 '20 at 00:08
  • This link should give enough info. https://askubuntu.com/questions/445364/disable-laptop-monitor-when-there-is-an-external-monitor?rq=1 – crip659 Jul 01 '20 at 01:50
  • @crip659 I know how to disable the monitor on my laptop by hand, either with the function keys or through the settings menu. What the question is about is wanting to close the lid while the laptop display is on, and have that action alone be what makes it turn off, and vice-versa, instead of having to go through a menu every time I'm about to close the lid and after I open it every time which is what your link describes. – metichi Jul 01 '20 at 09:51
  • Most laptop screens turn off when lid is closed(might need setting of laptop power). An external might close also unless a key is pressed or mouse moved to turn back on. My setup is external monitor and keyboard. Just have mirror display turned off in settings. – crip659 Jul 01 '20 at 10:40
  • You have power settings set to do nothing when lid is closed, not suspend? – crip659 Jul 01 '20 at 10:51
  • Reading the question again, you have setup to have part of screen on laptop and part on external when using both(doubling screen size), not same screen on both? – crip659 Jul 01 '20 at 12:23
  • @crip659 Yes, when I have the two monitors, it's set to extend desktop across them, not mirror. And yes, the screen does turn off when closing, but the OS still treats them as a continuous desktop and not moving the windows from that display to the external monitor. I know I can manually turn off the display in the laptop in the settings, but the question is whether it's possible to do it automatically when closing. – metichi Jul 01 '20 at 15:35
  • Use sudo evtest or similar to list the input event devices to see if one is the lid switch, then you might be able to listen to events from it and run xrandr to reconfigure your screens. – meuh Jul 02 '20 at 15:12

0 Answers0