Thursday, January 15, 2009

A new monitor on the scene

At last, it is not just a bare laptop with add-ons, but a real screen graces the table. A nice Acer P223W 22'', it fits right in with its black... anyway.

In Windows, there is no problem with a notebook and a display. You click a few times in the screen settings, works.

In Linux... it ain't so easy. I tried to use Gnome's preferences, but it just wasn't able to do anything as I wanted, dragging the screens around made them sometimes stick together, sometimes they moved on their own. Restarting Linux or Gnome produced random results - sometimes the screen was on after restart, sometimes not. It also liked to stay on before login and turn off after.

Searching around confirmed, that this is a known weakness of Linux, with no easy workaround. But there is hope:

xrandr is used to configure which display ports are enabled (e.g. LCD, VGA and DVI), and to configure display modes and properties such as orientation, reflection and DPI.

This is the simplest and most powerful way to get multi-monitor systems working using recent versions of Linux such as Ubuntu 7.10 and Fedora 8 with graphics chipsets such as the Intel 945GM/GMS and ATI Radeon found in Thinkpads.


The page tells the necessary minimum to start playing with it. Some configuring may need to be done, but it worked out of the box for me.

For what I wanted - turn the display on. while turning the laptop off, a simple command is sufficient:

xrandr --output LVDS --off --output VGA --mode 1680x1050


(LVDS is the laptop screen, VGA obviously my display. The screen resolutions can be found if you run xrandr without any parameters.)

To switch the displays back, use a similar, but opposite command. To make it even simpler, create scripts for daily use. Done.


It should be possible to set the monitors next to each other, with some tweaking of the xorg.conf. But to find a command, that does pretty much what you want with one slap is great.