Ubuntu – Geforce GT240M: How to disable Notebook screen and enable external Monitor


When i attach my Notebook (Nvidia Geforce GT 240M) to my Panasonic-TV via HDMI, both screens are activated. I use Nvidia-Driver Version 260.19.06.

I wonder how to deactivate my notebook display automatically or with one Script and switch to the external Monitor when attached. The TV needs an overscan-correction of 100px to display the whole screen.

I also want to close the notebook without deactivating the external monitor, what still happens now.

Is this possible?

Best Answer

Here is a simple script to turn off notebook display when external monitor is connected:

if xrandr -q | grep -q  "HDMI connected"; then
  xrandr --output LVDS --off --output DFP1
  xrandr --output VGA --off --output LVDS

If you want to set a specific resolution, you may add "--mode 1680x1050" in the end of xrandr lines. Output offset can be added using "--pos 100x0" command.

The script can be bound to any unused key combination or executed on startup using "System>>Preferences>>Startup Applications"

Note, that "DFP1" may be different on your system - check out 'xrandr -q' output with external monitor attached

Related Question