[ltp] hotplugging VGA monitor to T61

Jens Rutschmann linux-thinkpad@linux-thinkpad.org
Thu, 12 Mar 2009 00:14:50 +0100


nescivi wrote on 11.03.2009 14:50:
> Is there any solution so that I can just hotplug a VGA monitor to my T61, the 
> moment I need it?
> Right now, I find myself having to boot up with a monitor/projector connected, 
> which is sometimes inconvenient (especially at conferences, where setup time 
> is short).
> 
> Is there any way to get the T61 to recognise that something has been 
> connected?

I'm doing it as follows:

Make sure to change the hotkey mask before using the external monitor:
echo 0x8C7FBF > /sys/devices/platform/thinkpad_acpi/hotkey_mask

This switches the FN+F7 key combination to be handled by the bios on my T61 (at 
least that's what I think). AFAIK you won't get any key events any longer then.

You may get "your" hotkey_mask value by reading the hotkey_mask file before 
modifying it. Then convert the value to binary, switch the 7th bit from the 
right (->Fn+F7), finally convert back to hexadecimal.

Then make sure it is applied on reboot, or do it manually.

Pressing Fn+F7 now toggles between these modes:
-> external only -> internal + external show the same -> internal only -> 
external only ...

Now you can plug in the monitor even after X has been started, no logging out or 
whatever is required.

Of course this way you cannot show different stuff on the internal and external 
  monitors.

Try it with different resolutions, I learned that it automatically scrolls the 
screen when moving the mouse to the edge of the screen (if external resolution 
is smaller than the internal resolution).

I have to confess it's probably not the best solution, but it's working. If 
someone has some good arguments against doing it this way please post them. I 
absolutely don't know if this has any bad side effects.

Best regards,
Jens