Most of the forums will give information on how to get the dual monitors work with a desktop. But I didn't find any resources on doing this on a laptop.
Also, here dual monitors mean, I am using my VGA output to plug-in another monitor.
Even though doing this is damn easy, it is not properly mentioned anywhere. Here we go.
1. First backup your xorg.conf
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
2. Open up xorg.conf in your favorite editor
sudo gedit /etc/X11/xorg.conf
Most of the time, you will see something like this, towards the end of it.
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection
Even though I ran a config tool, it didn't change my xorg.conf.
3. Replace the above part with the following.
Section "Device"
Identifier "Configured Video Device"
EndSection
Section "Monitor"
Identifier "Laptop LCD"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Laptop LCD"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2720 900
EndSubSection
EndSection
4. You need to change the line starting with "Virtual".
the value 2720 in the line Virtual 2720 900 is sum of horizontal values 1280 and 1440 of my two monitors and the vertical I left the higher 900.
You can get the monitor sizes by going to, System -> Preferences -> Control Center and then click on Screen Resolution. You should see two monitors in that.
Then save xorg.conf file.
5. Now reload X by pressing ctrl+alt+backspace. This will log you out, so make sure you save all your work before pressing that.
6. Once you login back, type
xrandr --output VGA --left-of LVDS . You should now see its working.
7. Now if you leave it like this, then you will have to execute step 6, each and every time you login. Not only that, since you have configured the xorg.conf statically, you might have problem with the displays, if you try to start without the extra monitor.
So you have to do the following to get the real "plug-n-play" capability.
To do this get the script from
here and save in to the file "/etc/X11/Xsession.d/45custom_xrandr-settings".
That's it.
As you can see, this uses a basic trick. This will create a one large window merging two screens. That is why you set the virtual line in the config file, as the sum of horizontal values, so that each monitor will show a portion of it.
Resources :
[1] : http://www.thinkwiki.org/wiki/Xorg_RandR_1.2#Now_automate_it_on_login
[2] : http://ubuntuforums.org/showthread.php?t=875045#post_message_5943883
Read more...