Laptop, docking station, external monitors
I have a Lenovo ThinkPad T460s, its docking station, and two external monitors. What I'd like to end up with is, when my laptop is docked, it can stay closed (and NOT suspended!), the primary display is an external 1920X1080 monitor, and my 4K monitor is secondary. Then, when undocked, it goes back to only using it's primary monitor and will once again suspend when the lid is closed.
Responses
Your laptop seems to have two GPUs: an Intel HD Graphics 520 integrated to the main processor, and a NVIDIA GeForce 930M in addition to it. This is known as NVIDIA Optimus technology. This can make things pretty tricky in Linux, as it might be that each display output might be connected to just one of the GPUs. Usually, the laptop's integrated display is wired to the Intel GPU: the other outputs might be wired to either GPU.
There is a lot of important details, and only someone with the exact same laptop model could provide accurate step-by-step instructions. Unfortunately I don't have a Lenovo laptop, so I can only provide an outline of the procedures needed. I hope it is of some use; if nothing else, you'll get some keywords to Google for.
To deal with Optimus the most seamlessly, you'll need a Linux distribution that is new enough to support version 1.4 of the Xrandr extension of the X11 protocol. In RHEL, that seems to mean 6.6 or newer, according to this: https://access.redhat.com/errata/RHBA-2014:1376
To understand your GPU/output mapping, start up your laptop and type xrandr. It will list one or more display outputs and possible resolutions for them. Initially, you'll see only the outputs attached to the GPU that is currently acting as the "primary" one. To verify that your X11 server supports Xrandr version 1.4 and has successfully detected both GPUs, type xrandr --listproviders. It should output a line of information for each detected GPU and their associated drivers.
To make the other GPU's outputs usable, you'll need a command like xrandr --setprovideroutputsource <secondary GPU> <primary GPU>. After this, there should be more outputs listed in the xrandr output, and you can then use the xrandr command or the display settings tools of your desktop environment of choice to arrange the displays as you wish: for example, you can extend your desktop to both external monitors and disable the integrated one. Once you get your displays all manageable by xrandr (and by extension, the tools of your desktop environment), then the X11 server will generally do the right thing when displays are unplugged, e.g. when undocking. When new displays appear, i.e. when you're docking your computer, your desktop environment might remember the previous settings for a docked configuration for you and handle it automatically; if not, you might want to write a script with one or two xrandr commands to set up your display layout exactly as you wish after docking, and perhaps associate it to a function key or a desktop icon for convenience. If the docking produces a recognizable udev event, you might even be able to write an one-line udev rule to trigger the script automatically on docking for you.
If your dock includes a power button for your laptop, you can use it to power it up while closed. If you need to have your laptop open while starting it up, and then dock & close the lid, it depends on how the power management in your ACPI firmware is set up to handle it. It is possible that the laptop will automatically allow closing the lid when docked without triggering a suspend operation - have you tried?
Your desktop environment's power management settings could also affect the suspend behaviour: there are typically separate settings for actions when docked/on external power and when undocked/on battery power. Typically, you choose the "on external power" tab, then set "On Lid Close..." -> "Do nothing". This should have no effect on what will happen when on battery power.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
