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

NoteThis tool should automatically get installed with most window managers as they use it to manage the displays.

Configuration

A common way to execute X related scripts is the use of ~/.xinitrc or ~/.xprofile. 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:

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:

user $xrandr --output LVDS --mode 1024x768

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

user $xrandr --output LVDS --mode 1024x768 --rate 75

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 Ctrl+Alt+Backspace 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:

user $cvt 1024x768 refresh 75

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