Switching displays with a Lenovo T60 + Ubuntu 7.10 (Gutsy Gibbon) 

Background…

I have been running Ubuntu on my home & office systems for about 10 months now. Great stuff. Although I still cannot get away from windows completely, I would say that about 4% or less of my time is now spent on a windows system. I am truely satisfied with my ubuntu setup on my IBM Lenovo T60 Thinkpad.

Problem…

That said, there is still room for improvement in several areas. One of the things that has been annoying me is the loss of my function keys — primarialy, fn+F7 — that used to toggle my displays between laptop screen & external displays like a VGA monitor, or a projector.

Old workaround…

As a workaround, if you boot the system with a monitor/projector/docking station then ubuntu will automatically detect and enable the display. I have had mixed results with projectors though… The problem with this is that it requires a reboot & that can be extremely inconvenient depending on how many files you have open & how big of a hurry you are in. In addition, depending on your setup, your laptop display may turn off during the detection of the external monitor. That leaves you with a blank screen on the laptop — and when it comes time to go mobile, you need to reboot again. Yuck…

A Better Solution…

Recently I found a much better solution that simply involves running a command that can detect displays. This is still not as convenient as fn+F7 was in windows, but it gets the job done & without a reboot. Here’s what I did:

Make sure you have xrandr installed — “xrandr is a utility to use the X Resize, Rotate, and Reflection”.

sudo apt-get install xrandr

Then, use xrandr as needed to detect laptop or external displays. Below are a few versions of the command that I have found my self using. The most common ones are the first two:

xrandr –output VGA –auto # Autodetect the VGA
xrandr –output LVDS –auto # Autodetect the laptop display
xrandr –output LVDS –mode 1024×768 # Specify the laptop display resolution
xrandr –output VGA –left-of LVDS # Extend the VGA to the left of the laptop
xrandr –output VGA –right-of LVDS # Extend the VGA to the left of the laptop

Of course, check out the man page for xrandr to find additional information about the command options

man xrandr

Useful Resources…

  1. Article about Xrandr – This post got me started on this topic — must read if you are interested in this topic.
  2. Thinkwiki – More info on setting up a T60 with ubuntu or other flavors of linux
  3. UbuntuForums – The best forum out there for finding solutions relating to the Ubuntu OS
Advertisements