[ltp] T60 lid switch and font size (hibernate issues)

Greggory Gruen linux-thinkpad@linux-thinkpad.org
Fri, 14 Sep 2007 21:03:14 -0400


Hello,

I've got Gentoo on a T60 (14", 1024x768, X1300).  I've got a dock at
home with an external LCD (1280x1024).  What I'll usually do when I want
to pack it up and take it with me is hibernate, then undock.  When I
resume, it still thinks the external monitor is attached, so I use this
little script and bound it to a key in fluxbox.

if [ $(cat /proc/acpi/button/lid/LID/state | grep -c closed) = 1 ] ;
then
        aticonfig --input=/etc/X11/xorg.conf -q --nobackup
--enable-monitor=tmds1,none
        sleep 3
        xrandr -s 1280x1024
else
        aticonfig --input=/etc/X11/xorg.conf -q --nobackup
--enable-monitor=lvds,none
        sleep 3
        xrandr -s 1024x768
fi


This works well, with one caveat.  I have to 'create' a lid switch event
while the machine is on.  Meaning, if I hibernate on the dock, and I
want to resume while on the road, I have to open the lid to power it on,
wait until it resumes, close the lid, reopen it, then do my script.  Can
I eliminate this extra open-close somehow? 

Also, when I resume, the font sizes are completely hosed up.  Fonts in
firefox and evolution are super small and impossible to read in some
cases.  The only way to fix it is to restart X, which I currently can't
do without restarting the machine.  (If I use my script to switch
screens, it gives me a blank screen when I exit X.)  Could this be a DPI
issue?  My monitor sections in xorg.conf are as follows:

Section "Monitor"
        Identifier   "onboard LCD"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
#       DisplaySize     285 214
EndSection

Section "Monitor"
        Identifier   "Sony LCD"
        DisplaySize  338 270
        ModeLine     "1280x1024" 108.0 1280 1328 1440 1688 1024 1025
1028 1066
        Option      "VendorName" "Sony"
        Option      "ModelName" "SDM-HS75P/S"
        Option      "DPMS" "true"
EndSection

If I uncomment the commented line above, it makes the fonts on my
external LCD very huge even though it's in the section for the internal
LCD. 

Thanks
Gregg