HDMI/VGA display detection solution
Here is my solution about second display detection before login screen. First of all I configured xorg for one screen only with Catalyst Control Center (CCC) and saved xorg.conf as xorg.conf.mono in /etc/X11. Then I connect second monitor to HDMI and reconfigures xorg for double screen with Xinerama enabled and saved xorg.conf as xorg.conf.dual in /etc/X11.
The only way I’ve found to detect another display on HDMI/VGA port is by reading xorg log file after it loads (/var/log/Xorg.0.log). If display connected through HDMI there is “DFP1 connected” line present and “DFP1 disconnected” if not. The same is for VGA except that DFP1 should be changed to CRT1 I guess.
Ok, I need system to load xorg then read log file then select right config file (xorg.conf.mono/xorg.conf.dual) and put it as /etc/xorg.conf and restart xorg. This actions needs to be done before GDM loads because I don’t need any screen flickering with login screen
There is such script (/etc/gdm/Init/Default) which GDM runs before loading for initializing. I wrote a little script for actions I need and put it on top of just before <code>PATH=/usr/bin:$PATH</code> line /etc/gdm/Init/Default.
Here it is:
ISMULTI=`/bin/cat /var/log/Xorg.0.log | /bin/grep -c 'DFP1 connected'`
ISMULTI_MUTEX=/etc/X11/fglrx-multi-xorg-killed
if [ "$ISMULTI" != "1" ] ; then
/bin/cp /etc/X11/xorg.conf.mono /etc/X11/xorg.conf
if [ ! -f "$ISMULTI_MUTEX" ] ; then
/usr/bin/touch "$ISMULTI_MUTEX"
/usr/bin/killall Xorg
else
/bin/rm "$ISMULTI_MUTEX"
fi
else
/bin/cp /etc/X11/xorg.conf.dual /etc/X11/xorg.conf
if [ ! -f "$ISMULTI_MUTEX" ] ; then
/usr/bin/touch "$ISMULTI_MUTEX"
/usr/bin/killall Xorg
else
/bin/rm "$ISMULTI_MUTEX"
fi
fi
Now when booting with second display connected, I got two enabled displays on login screen ready and vise versa.
Nice!
In my case I had to use /bin/grep -c ‘Connected Display1: CRT on primary DAC’ instead with my VGA monitor
Teledhil
December 11, 2009 at 02:01
Hey egaistek!
I have a CW series Vaio. I’m running 9.10 and I need a little help. I have the same brightness problem as the FW laptops. I have no control over brightness and I was wondering if you knew of a fix for the CW series. Thanks.
Justin
December 16, 2009 at 18:30