Friday, January 4, 2008

XRandR Drawer

I do pretty much all of my computer work on my laptop. The mobility is great, but tasks that require a lot of screen real-estate, such as using eclipse, can be a real pain on a small screen. Thus, I use an external LCD when I'm at my desk. Back when I used Windows, it was a breeze to extend your desktop, and it's not too bad in Linux once you figure out your xorg.conf file.

Since my current laptop sports an Intel graphics chipset, one of the things I've been able to fully take advantage of is xrandr, which essentially lets you change your xorg configuration on the fly. This is great because it's very simple to use, doesn't require root access, and lets you make changes without restarting your X server (something extremely handy when you move around a lot).

There are a few programs that provide a GUI for xrandr, but from my experiences with them, they all seem to be buggy or hard to use. This lack of a simple way to control your external monitor led me to create my own: by adding a drawer and a few custom application launchers to your gnome panel, you can create a simple and fast way to manipulate your screen(s).

Here are the shortcuts that I use:
  • "External Monitor to the Left"
    xrandr --output VGA --auto --left-of LVDS
  • "External Monitor to the Right"
    xrandr --output VGA --auto --right-of LVDS
  • "Clone Main Screen"
    xrandr --output VGA --auto --same-as LVDS
  • "No External Monitor"
    xrandr --output VGA --off
It's as simple as that. I believe that nvidia-settings has similar command-line functionality, so people with nvidia cards can do this too.