Jan 30, 2009

Linux, Dual Head and Background Images

The other day I got a new monitor in the mail from NCIX (who I highly recommend if you haven't heard of them). I realized that having two monitors at my last job gave me much more productivity, but since I work at home now I should have two monitors here. That's my excuse and I'm sticking to it.

I wrote a post less than a year ago on how to get dual head going with Compiz Fusion and back then it was really really annoying. Since then we have the nvidia-glx-new package right in Ubuntu, so there's no more having to shut down X in order to install the driver. Awesome.

So yeah, all you have to do is plug in your monitor, have nvidia-glx-new installed (assuming you're running an Nvidia card, no clue how to do it with ATI), open System->Administration->Nvidia X Server Settings, click X Server Display Configuration and enable things in there. For me, I had to click Detect Displays and click the monitor that is disabled. I clicked Configure, selected TwinView and off it went, working perfectly.

There was one last small issue. My desktop background was centred :(. So half of it was on one screen and half was on the other. There are two real fixes for this. If you just want the same image on both sides, you right-click the desktop (in Ubuntu), go to "Change Desktop Background", and set Style to Tiled. Done!
If you want to have two different backgrounds, the easiest option is probably just to take your current image, add some space to the right of it and paste a new image there. Then save your huge image as a file and select that as your desktop background.

On another note, having two screens like this for web development is awesome. I can fit a browser window, two IM windows, GVim and two terminals all without overlapping. Maybe it's time to try a tiling window manager!

7 comments:

Ryan Kohn said...

For ATI, I recently discovered amdcccle, which is the ATI Catalyst Control Center for Ubuntu. It's in the repositories as fglrx-amdcccle. Once installed, you can find it under Applications > Accessories > ATI Catalyst Control Center.

It was pretty magical when I first discovered it, since I never had Big Desktop with Compiz before.

Be warned that it is indeed proprietary. Some people have something against that. :P

Rob Britton said...

Nice, nice. I remember when I had an ATI card with openSUSE and it was a nightmare to get Beryl to work with it. Good to hear they're getting better.

Proprietary is fine, so long as the company isn't trying to screw you over. Although in the case of video drivers, I might accept being screwed a little since the open source equivalents are so much worse.

Tony said...

My questions for Rob:

- What version of Ubuntu are you using?
- What version of the Nvidia driver?
- Is your Twinview configuration persistent, or does it reset to a single head configuration (with a disabled monitor) when you reboot?

I am running Ubuntu 9.04 and have the 96.43.10 version of the driver, and am having the described problem. I try to use the Nvidia interface to write the configuration to my xorg.conf file, but the file can't be created.

Any thoughts or words of advice? Thanks.

Rob Britton said...

@Tony: When I wrote this article I was using 8.10, now I'm using 9.04 and it still works fine. I'm using the 180.44 Nvidia driver, but it is the x86_64 version so the numbers might be different. And no, the display doesn't reset when I reboot.

You might not have access to the xorg.conf file. Try running the nvidia-settings using sudo from a terminal:
sudo nvidia-settings

Mainframeguy said...

Just letting you know this came high when I was trying to find our how to have a common desktop background image which spans both heads - I am just curious since I expect you know.... I think of two strategies to achieve this.

1. Take an image and make it the right proportions to occupy both screens then centre it.

2. Take the same image and split it into two down the middle and place on on each desktop.

I think I shall try 1. as it is maybe less work - any opinions?

Rob Britton said...

Go for #1, it's nice and easy to do.

Mainframeguy said...

I can confirm, having done it now, option one is the WTG unless you want anything fancy like partial rescaling for different screen sizes