Wednesday, June 11, 2008

Howto setup dual screen for Compiz in Ubuntu Hardy

If you need to give presentations with your laptop and you are running Ubuntu Hardy, you might find that the gnome-display-properties (System>Preferences>Screen Resolution) do not work out of the box. So it is impossible to connect a beamer unless you clone. The same is true for a dual screen setup with Compiz.



There is however a very easy trick to solve this. I have tested it with an Asus Eee PC 701 4G and with my Ati Radeon X600 desktop system. I am now enjoying running dual screen with all the 3d desktops enabled.

The problem is that the default screen size configuration is too small, which does not allow you to place too screens next to each other. On the other hand Compiz can not handle texture sizes bigger than 2048x2048, which means for example two monitors of 1024x768. If you want to use bigger resolution, it is still possible, but you will need to turn off compiz and will loose the 3d effects.

So to solve it, fire up a terminal:
$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
$ sudo gedit /etc/X11/xorg.conf


Then find the "Screen" section and change it like this:
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Virtual 2048 2048
EndSubSection
EndSection


To undo, you can just type:
$ sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf


After doing this, you will be able to use gnome-display-properties with ease and run dual screen setups like this:

9 comments:

  1. Two additional things:

    * if you have an Intel 965 video, you can patch the video driver and libmesa to get Compiz on screens larger than 2048x2048

    * compiz often becomes hopelessly confused after you play with xrandr, so if something seems weird, the first thing to try is Alt-F2, compiz --replace, Enter. Sometimes you have to do this blindly.

    ReplyDelete
  2. Yes, you can patch libmesa, but still it would limit you to 4096x4096 which should be fine for most dual screen setups. Probably this will be included in Intrepid.

    ReplyDelete
  3. i think this may be the answer to solve my problem. could i possibly take a look at your xorg.conf for your desktop with dual monitors?

    ReplyDelete
  4. Sure, I'll post it here. Send me your email in case you want it as a text file. So this is my xorg.conf file for the Eee PC. This makes connecting a beamer/monitor working perfectly:

    # xorg.conf (X.Org X Window System server configuration file)
    #
    # This file was generated by dexconf, the Debian X Configuration tool, using
    # values from the debconf database.
    #
    # Edit this file with caution, and see the xorg.conf manual page.
    # (Type "man xorg.conf" at the shell prompt.)
    #
    # This file is automatically updated on xserver-xorg package upgrades *only*
    # if it has not been modified since the last upgrade of the xserver-xorg
    # package.
    #
    # If you have edited this file but would like it to be automatically updated
    # again, run the following command:
    # sudo dpkg-reconfigure -phigh xserver-xorg

    Section "InputDevice"
    Identifier "Generic Keyboard"
    Driver "kbd"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "us"
    Option "XkbVariant" "intl"
    Option "XkbOptions" "lv3:ralt_switch"
    EndSection

    Section "InputDevice"
    Identifier "Configured Mouse"
    Driver "mouse"
    Option "CorePointer"
    EndSection

    Section "InputDevice"
    Identifier "Synaptics Touchpad"
    Driver "synaptics"
    Option "SendCoreEvents" "true"
    Option "Device" "/dev/psaux"
    Option "Protocol" "auto-dev"
    Option "HorizEdgeScroll" "0"
    EndSection

    Section "Device"
    Identifier "Configured Video Device"
    EndSection

    Section "Monitor"
    Identifier "Configured Monitor"
    EndSection

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

    Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Default Screen"
    InputDevice "Synaptics Touchpad"
    EndSection

    ReplyDelete
  5. thanks, that's just what i was looking for!

    ReplyDelete
  6. Hello, I notice that you use a picture with wrong ubuntu version on your blog. It's not 7.10, but 8.10.

    ReplyDelete
  7. After dist-upgrading to intrepid, my X was having some troubles, I had previously been running extended screen with different resolutions, but no, no matter how many times I tell the display-properties thing to lign up the displays, it keeps making them clone-mode, even if the clone mode checkbox is not checked, anyone else having this problem? (ibm lenovo x60s with i945 (i810 driver))

    ReplyDelete
  8. Do you by any chance know how to set up xorg.conf to handle HDMI instead of regular monitor cable?

    ReplyDelete
  9. how to change xorg.conf in lucid??
    now i'm running lucid & try to configure compiz with dual screen. no hope

    ReplyDelete

Filter by topic: spe, python, ubuntu