Tuesday, June 5, 2012

External VGA monitor and Xrandr in XFCE

Finally, around Ubuntu 11.10 or so, my laptop's VGA output became usable.

Hooray for all those kernel hackers!

Now, the VGA monitor is detected during an existing X session (instead of restarting X), it doesn't flicker anymore, and XFCE's settings show it right away.

1) Plug in the monitor and turn it on. XFCE can already be running.

2) Go to Settings Manager --> Display, click on the monitor, and click the "use this output" checkbox.

[Optional] 3) Go to Settings Manager --> Desktop, and choose a distinctive desktop for the monitor.

[Optional] 4) To use the monitors side-by-side (extended mode) instead of the default mirrored mode, open a terminal window and try:
$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 1536, maximum 8192 x 8192
VGA-0 connected 1024x768+0+768 (normal left inverted right x axis y axis) 304mm x 228mm
   1024x768       74.9*    75.1     70.1     71.8     60.0  
   832x624        74.6  
   640x480        72.8     75.0     66.7     60.0  
   640x400        70.1  
LVDS connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1366x768       60.0*+
   1152x768       59.8  
   1024x768       59.9  
   720x480        59.7  
   640x480        59.4


From this command, you can see that the displays are named LVDS (laptop) at 1366x768 and VGA-0 (ext monitor) at 1024.768. Let's move VGA-0 to the right of LVDS:

$ xrandr --output VGA-0 --auto --right-of LVDS

The command also works with --left-of, --above, and --below. Xrandr changes like this are not persistent across restarts, so redo it every time, put it in a bash alias, or script it into the startup.

Now I have a second (smaller) screen to the right.

No comments: