Tag search

Setting up dual monitors system-wide with XRandR on Debian Lenny

by Sander Marechal

I have been playing with my monitor setup again on my Dell D530 laptop. The internal monitor of the laptop is 1400x1050 pixels, but I usually use a 19" external monitor set to 1280x1024. With Etch this worked flawlessly. When the external monitor was hooked up and the lid on my laptop was closed, then my desktop would be 1280x1024. When I booted with the lid open and no monitor attached, the desktop would be 1400x1050. When I upgraded to Lenny this stopped working. I had to change the resolution each time I changed from external screen to internal screen and back. I reported a bug about this but the answer came down to “It’s not a bug but a feature. Use XRandR to change your displays if you don’t like it.”

So, I dove into XRandR. I wanted this to work for all users, so simply sticking some XRandR commands in the gnome session startup wasn’t going to suffice. At the same time I also got interested in trying a dual-head setup instead of only an external monitor when one was connected. I was going to need completely different layouts depending on the external monitor. It took a while before I figured out how to do it, it took a little longer to fight GNOME into submission, but here is how to make it work.

Digg this article: This article on Digg