NVIDIA dual monitors on an Ubuntu laptop
I recently rebuilt a laptop. I tried the Nouveau driver, but the laptop's battery life plummeted to an hour so I headed back to the proprietary NVIDIA driver. I used to use twinview and had a custom xorg.conf with a single script to run xrandr. For some reason that still eludes me the same configuration isn't working this time around. It's still Ubuntu 12.04 and the same display. I noticed that when I activated twinview the fonts got messed up on the laptop screen but were fine on the larger display. I wanted to more fully configure each monitor to resolve that, but I didn't see how to do that through twinview. So I let nvidia-settings generate a new configuration. Then I made the following changes:
Change Monitor0
Option "UseEdidDpi" "FALSE"
# Option "DPI" "144 x 144"
Option "DPI" "96 x 96"
Note that the higher dots per inch setting is what messes up the fonts.
Change Device0
Option "RegistryDwords" "EnableBrightnessControl=1"
Enable the brightness keys on a Lenvo W520.
Change Screen0
# strip metamodes
Xrandr
Once the second monitor is added I use xrandr to enable, disable, and configure the additional screen.
# enable the second screen
xrandr --output LVDS-0 --auto --pos 0x0 --output DP-0 --auto --right-of LVDS-0
# disable the second screen
xrandr --output LVDS-0 --auto --pos 0x0 --output DP-0 --off
The new xorg.conf (without twinview or xinerama):
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 331.20 (buildd@allspice) Wed Dec 18 09:07:35 UTC 2013
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
Section "Files"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Lenovo Group Limited"
HorizSync 56.5 - 67.8
VertRefresh 50.0 - 60.0
Option "DPMS"
Option "Primary" "true"
Option "UseEdidDpi" "FALSE"
#Option "DPI" "144 x 144"
Option "DPI" "96 x 96"
EndSection
Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor1"
VendorName "Unknown"
ModelName "HannStar Display Corp HH251"
HorizSync 24.0 - 80.0
VertRefresh 56.0 - 75.0
Option "DPMS"
Option "RightOf" "Monitor0"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro 1000M"
BusID "PCI:1:0:0"
# Screen 0
Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Stereo" "0"
# Option "metamodes" "LVDS-0: nvidia-auto-select +0+0; LVDS-0: nvidia-auto-select +0+0"
# Option "metamodes" "LVDS-0: nvidia-auto-select +0+0, DP-0: nvidia-auto-select +1920+0; LVDS-0: nvidia-auto-select +0+0, DP-0: null"
# Option "SLI" "Off"
# Option "MultiGPU" "Off"
# Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSubSection
EndSection