Disable laptop monitor if external monitor is plugged

At work now I use an old laptop connected to a monitor. With arandr you have a GUI for spacer.gifspacer.gifsetting the dual monitors. What I wanted was to switch off the built-in display:

 EXTERNAL_OUTPUT="VGA" 
INTERNAL_OUTPUT="LVDS" 
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
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s