Xrandr

RandR and the tool xrandr are used to manage screen resolutions, roation and screens with multiply displays in X. Future versions will also support GPU via USB.

Installation
You can install with the following command:

Configuration Files
A common way to execute X related scripts is the use of or. Just out 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, as the nNvidia or AMD binary, do not support xrandr or faulty hardware report wrong EDIDs, but even 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:


 * LVDS - laptop monitor
 * DVI - digital external port
 * VGA - analogue VGA external port
 * TV - TV-Out (like HDMI)
 * S-video - radeon integrated TV-Out
 * DP - DisplayPort (like HDMI)

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 you will either get an error or the screen goes blank now, because 75kHz is not supported. This will last until the next session, you can use ++ to restart X in case something goes wrong. To add a 75Hz mode, first get a proper modeline using the tool cvt:

Copy everything from the output but the Modeline at the beginning and append it to the following command like:

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
 * - GTK Desktop tool
 * - KDE Desktop tool
 * - LXDE desktop tool

External resources

 * - xrandr man page
 * - Xorg Foundation