Extending Xubuntu desktop to external display using xrandr

Few weeks ago I’ve bought a new laptop and I’ve installed a new Xubuntu 11.10 on it. Surprisingly (and sadly), when I tried to connect an external display to it, I found out that it’s impossible to do it in “out of the box” version of Xubuntu. I had only a choice to use my external display instead of the internal one or to do a “mirror” configuration, having the same on both displays… Satisfying? No, thanks. I had to find out how to do it in the way I want it to work.

After googling for a while I found a nice solution. It was working nicely, but not really satisfying for me. First, I had a problem with bottom Xubuntu menu. It was impossible to open it, because bottom of the screen was “below” the physical display, but wanted displays to be set this way, so the bottom edges of the displays were in the line:

                         |                       |
        ,---------------.|                       |
        |               ||         HDMI1         |
        |     LVDS1     ||                       |
        |               ||                       |

The other thing was that I was not satisfied with the “automatization” level of that solution too (and I was in a mood to code a bit), so I wrote a Python script to solve my problem and – in general – make it easier to switch to dual-display mode. You’ll find a link below. Here’s how it works:

./displaymanager.py -m dual -i "LVDS1;1366x768;60" -e "HDMI1;1920x1080;60"

and back to single display, with one command:

./displaymanager.py -m single -i "LVDS1;1366x768;60" -e "HDMI1"

It puts external display to the right by default (order is: “ie”) – to put it to the left use argument:

-o "ei"

You can bind both commands to – for example – menu items (activators?) to use it in a comfortable way.

You can find this script on https://github.com/regispl/displaymanager – you’ll find a README there, so it should be quite easy to use it.


Comments are closed.