Friday, April 25, 2008

xrandr with Ubuntu 8.04 and external monitors on laptops

So I installed Ubuntu 8.04 onto my Dell Inspiron 700m. I was impressed with everything it is doing well right out of the box (display, power management, wireless, etc.).

However, one item I was really looking forward to was xrandr and the ability to dynamically plug in external monitors or projection units. In trying this I failed to get my external monitor to dynamically configure via xrandr. However, the solution to this was simple.

The default xorg.conf was:

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection

I modified this by adding in the subsection display:

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Virtual 2560 1024
EndSubSection
EndSection

Next restart X (logout and in, or cntrl-alt backsapce). Note that for me the entry was 2560 1024 since my internal display is 1280x800 and the external is 1280x1024 so 1280 + 1280 = 2560 and 1024 > 800 so use 1024. You will need to do the math for your case.

At this point the "Screen Resolution" application works correctly to set up the displays. Readers may also be interested in the article at http://www.thinkwiki.org/wiki/Sample_Fn-F7_script which shows a nice shell script that can be connected to key combinations for all this.

take care
Doug

UPDATE April 28th:

Just a follow up to this posting. It turns out that in several cases (and low end laptop graphics like mine among them) that doing this will

disable DVI and thus not allow you to run compiz

For me nice graphics vs dual monitor is a no contest. I'll take the dynamic xrandr over compiz any day.

4 comments:

Luke said...

I was having an identical problem on my ThinkPad T40 with Hardy (8.04).

Your solution worked perfectly for me EXCEPT that I needed EndSubSection rather than End SubSection. The extra space made my start up in low-resolution graphics mode with a host of other problems.

Thanks!

fils said...

thanks.. I typod when making the blog.. I will fix it.

Doug

Alper said...

After so many years external monitor works. Thanks to xrandr and Fils.

Fils, when you have two monitors, where does your gnome panel located? My gnome panel goes to external monitor screen instead of staying in main screen?

Alper said...

Sorry, I just figured it out that I can move the panel myself..
thanks