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

Tue Dec 5 07:53:37 UTC 2017
Toralf Lund <toralf.lund at pgs.com>


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