Xrandr

RandR and the tool xrandr are used to manage screen resolutions, rotation and screens with multiply displays in X. With version 1.4 support for multiply graphics cards was introduced, future versions (>1.5) will also support monitors attached via USB (this will probably be merged with xorg-server 1.13 with support for DisplayLink, hotplug-displaylink).

Installation
You can install with the following command:

Configuration
A common way to execute X related scripts is the use of or. Just put the line of code for xrandr in one of these files and it will be executed on every X startup to make settings permanent.

Usage
xrandr uses the monitors EDID to identify its capabilities. Some graphic drivers like the binary Nvidia or AMD, do not support xrandr. Also faulty hardware might report wrong or bad EDIDs, in those cases it is still possible to use custom made setups by trial and error.

Screen Query
Running xrandr without any arguments will show attached monitors and its capabilities:

A list of different types for connectors and the naming scheme for RandR:
 * LVDS - Laptop Screen
 * HDMI - High-Definition Multimedia Interface
 * DVI - Digital Visual Interface
 * DP - DisplayPort
 * VGA - Video Graphics Array
 * TV - Composite Video
 * S-video - S-Video

Screen Modes
A mode always consists of a resolution and a refresh-rate. With a query the hardware reports which modes are supported. It is possible to define own modes in case the hardware reports wrong information. To change the mode for an attached device:

It will use the highest refresh-rate in that mode, to also change the refresh-rate (in kHz):

The changes apply immediately and on the hardware listed above it might either produce an error or the screen goes blank, because 75kHz is not supported. This will last until the next session, using ++ will terminate the session and restart X in case something goes wrong. To add a 75Hz mode, the tool cvt can be used to get a proper modeline:

Everything after Modeline needs to be appended to the following command:

Running the query again should list our new added mode.

Screen Manipulation
Some common tasks using xrandr:
 * Extend to an external monitor (left-of, right-of, above, below, same-as):


 * Set the primary display if more than one is attached:


 * Rotate a display (normal, left, right, inverted):


 * Turn off the monitor

GUI Tools
There are several GUI tools to use xrandr, here is a list of tools supported in Gentoo:
 * - independent GUI tool
 * - KDE Desktop tool
 * - LXDE Desktop tool

External Resources

 * xrandr man page
 * Xorg Foundation