[ltp] autodetecting ext. monitor presence

André Wyrwa linux-thinkpad@linux-thinkpad.org
Wed, 05 Nov 2003 23:32:19 +0100


> You could do the autodetection on startup with a X wrapper script that
> looks something like this:
> 
> --- cut here ---
> 
> #!/bin/sh
> if [ `tpctl --io | grep "bus" | cut -c41` == "Y" ]; then startx --
> -layout Multihead; else startx -- -layout Singlehead; fi
> 
> Of course you will need to have thinkpad and tpctl packages installed.
> 
> --- cut here, fold in two times in the middle and put in your pocket ---

Ooops, was a little distracted while writing these lines.

However, forgot to mention:

[ `tpctl --io | grep "bus" | cut -c41` == "Y" ] 

only probes for connected dock,
but you can probe for the monitor being connected directly with

[ `tpctl --id | grep "monitor type" | cut -c41` != 0 ]

Andre.