[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: xrandr w/ laptop and ext monitor



On Wednesday 02 December 2009 05:42:28 Joseph L. Casale wrote:
> Is it possible to create the default whereby the builtin LVD is then turned
>  off if the external LVD or VGA is connected? This would accomplish what I
>  need equally well.

This little script does exactly that, for me:

#! /bin/bash
if
xrandr | grep "VGA1 connected";
then
xrandr --output VGA1 --auto --output LVDS1 --off ;
fi
exit

Put it somewhere to run automatically upon login (I have it in KDE's Autostart 
configuration), and you're done. However, if you connect VGA after login, you 
need to execute the script manually. If something doesn't work, look at the 
output of "xrandr" in the terminal, maybe your devices have different names.

And of course, you need to do

xrandr --output LVDS1 --auto --output VGA1 --off

before you disconnect VGA, if you don't plan to reboot the machine.

HTH, :-)
Marko


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]