[CentOS] [External] Re: Switch off laptop screen when docked with lid close - CentOS 7

Thu Dec 7 13:44:16 UTC 2017
Toralf Lund <toralf.lund at pgs.com>

On 05/12/17 14:16, Fabian Arrotin wrote:
> On 05/12/17 08:53, Toralf Lund wrote:
>> Hi,
>> 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...
>> Thanks,
>> - Toralf
> Running CentOS 7/Gnome 3 and I also use two external monitors connected
> to my docking station.
Thanks. That's useful information.

>   When laptop is docked (so lid is closed) internal
> display is turned off and only external displays are used.
Just wondering, what's the normal sequence of operations when you 
connect? In my case it's generally,

 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.

> 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)
Anyhow, I think I've found what the issue is, at least in part: I 
actually switched to the LightDM display manager, on a somewhat 
experimental basis. I had GDM at first, but never actually docked the 
laptop before the chance. I didn't really think about that when I posted 
the original message, and also thought the laptop lid etc. would be 
handled at a different level, but it would appear not. If I use GDM 
(which I've now tested once more), the display is disabled at the login 
screen, and this "translates" into the desktop, at least if its "local" 
monitor config is cleared. With LightDM, all 3 screens are active, the 
the setting is also carried through to the desktop.

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

> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos