[ltp] how to automate xrandr with Port Replicator and second Monitor (W500)

Alex Deucher linux-thinkpad@linux-thinkpad.org
Mon, 31 Jan 2011 22:13:58 -0500


On Mon, Jan 31, 2011 at 8:23 PM, Andre Wyrwa <a.wyrwa@gmx.de> wrote:
> Hei,
>
> i've got a W500, port replicator and a monitor attached to it.
>
> Now i have a (silly?) habit of docking/undocking the box while it's
> running. No probs, there. But...
>
> When it's running standalone and i dock it, it fails to automatically
> recognise the second monitor. Is there any way to trigger that? Even via
> a little snipplet? And the same the other way around?

If you can get an acpi dock/undock event, you can trigger an xrandr
command on the event to reprobe monitors.  You will only get a hotplug
event (see below) if you actually connect/disconnect the monitor.

>
> Likewise, when docked and i switch off the monitor, xrandr remains in
> dual display mode. I'm not sure if monitors generally send a signal back
> through the line when they are entering/leaving standby mode. Is that
> the case? If so, how do i make X react on it?

If you are using KMS, the hw gets an interrupt for digital monitor
(DVI, HDMI, DP) hotplug events (monitor plug or unplug) and generates
a kernel event that clients can listen for.  Just turning a monitor
on/off is not enough as monitors are required to maintain power to the
edid circuity even when they are off.  You can have some app/script
listen for hotplug events from the kernel and take appropriate action.
 IIRC, fedora handles these in newer versions, not sure about other
distros.  There's no way to get any events from just turning the
monitor on/off.

Alex

>
> (Distro is Gentoo, but i'm fairly comfy with my cross-distro
> interpretation skills. ;-) )
>
> Thanks,
> Andre.
>
>