2011-05-07, 07:29
A while ago I found a simpler fix for this issue. Please note, this is not my code, I can't find the original post, but it works.
Basically, If a connection is sensed on VGA output, it switches the laptop LCD off.
create a file in /etc/X11/Xsession.d called 45custom_randr-settings
and enter the following:
now you'll note the first two lines pick the internal or external ports,
so by doing
You should be able to set it for VGA1 or DVI1 and external output.
Hope this helps someone.
Basically, If a connection is sensed on VGA output, it switches the laptop LCD off.
create a file in /etc/X11/Xsession.d called 45custom_randr-settings
and enter the following:
Quote:EXTERNAL_OUTPUT="VGA1"
INTERNAL_OUTPUT="LVDS1"
xrandr |grep $EXTERNAL_OUTPUT | grep " connected "
if [ $? -eq 0 ]; then
xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto
else
xrandr --output $INTERNAL_OUTPUT --auto --output $EXTERNAL_OUTPUT --off
fi
now you'll note the first two lines pick the internal or external ports,
so by doing
Quote:xrandr -d :0 -qfirst, you can pick which ports you want to set.
You should be able to set it for VGA1 or DVI1 and external output.
Hope this helps someone.