Wednesday, December 22, 2010

Dual monitor, dual desktop

   I have 1 LCD which I want to use as second desktop. Although it's very easy in Windows and some other laptops with Ubuntu, it seems to be difficult with mine, even with Ubuntu 10.04 and latest Nvidia driver :(
  
  Edit : everything seems OK after some newer upgrade. Now I don't have to manually setting these stuff anymore :)



   Till now, I always prepare 2 xorg.conf files, one for 1 monitor, one for dual monitor. The first one is same to this entry, the second is below:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildd@palmer)  Sun Feb  1 20:21:04 UTC 2009

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "ServerFlags"
    Option         "Xinerama" "0"
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      "Sony Nvidia Default Flat Panel"
    HorizSync       29.0 - 47.0
    VertRefresh     0.0 - 61.0
    Option         "DPMS"
EndSection

Section "Monitor"
    # HorizSync source: unknown, VertRefresh source: unknown
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "LG L1982U"
    HorizSync       0.0 - 0.0
    VertRefresh     0.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 330M"
    Option    "ConnectedMonitor"    "DFP-0,DFP-1,CRT"
    Option    "NoLogo"    "True"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 330M"
    Option    "NoLogo"    "True"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "DFP-0: nvidia-auto-select +0+0"
    Option        "CustomEDID"    "DFP-0:/etc/X11/EDID_vaio_monitor.raw"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: 1280x1024_75 +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
   So, my work is creating a script to swap 2 file whenever I change from 1 monitor to 2 monitor. What's a pity that I can not use function buttons of my laptop :(

cp /etc/X11/xorg.conf ~/store/xorg.bak
mv ~/store/xorg.switch /etc/X11/xorg.conf
mv ~/store/xorg.bak ~/store/xorg.switch

with xorg.switch including content of second xorg.conf file (or the first one if you're currently in 2 monitor mode).

   Remember to run above script with sudo and then restart X server.

Hope this useful,

Cheers,

No comments:

Post a Comment