Switch off laptop screen when docked with lid close - CentOS 7


I'm using CentOS on a laptop that part of the time is connected to a
docking station with two monitor connected to it. When the laptop lid is
docked, its lid is closed, as the system is placed in a position where
it's not convenient to keep it open, let alone look at the screen.

Now in the past, with CentOS 5 (on a different laptop, but same physical
config) and 6, the screen has automatically been switched off in this
configuration - it's been as if it was no longer there after I docked
the machine, which is of course exactly what I want. After I recently
switched to CentOS 7, however, I no longer get this behaviour. Even
thought I can't see the screen, it's obvious that it's on, or at least
the system thinks so - it appears in display config, and  xrandr
mentions it as "connected".

Any idea what's going on? Shouldn't the screen just switch of
automatically? What part of the system is supposed to handle this
anyway? And what's the best way around my problem? I've already disabled
the screen in Display preferences, of course, but it seems like the
situation should ideally be handled at a more global level, and also,
*my* display config obviously has no effect on the login manager. Which
means I can't really log in while the machine is locked, as the monitor
is then still on, and guess where the login window appears...


- Toralf


Re: Switch off laptop screen when docked with lid close

By Fabian Arrotin at 12/05/2017 - 09:16

On 05/12/17 08:53, Toralf Lund wrote:
Running CentOS 7/Gnome 3 and I also use two external monitors connected
to my docking station. When laptop is docked (so lid is closed) internal
display is turned off and only external displays are used.
Same in gnome settings/displays : it shows my "Built-in display" as 'lid
closed' and so only my external 24" displays as enabled (as Primary and
Secondary) (and I confirm that display is also off, and only gets back
to enabled when I undock and open the lid)

Re: [External] Re: Switch off laptop screen when docked

By Toralf Lund at 12/07/2017 - 09:44

On 05/12/17 14:16, Fabian Arrotin wrote:
1. Close the lid of the laptop (when carrying from somewhere else.0
2. [ The laptop is suspended via the close action ]
3. Connect to the dock
4. Hit the power button so as to return from suspend.

I've tested this with MATE as well as GNOME.

This means I have a solution of sorts, but I'd really like to know why
the LightDM has this problem, and the details of how these things work
are still rather blurry...

- Toralf