RandR

RandR
Original author(s) X.Org Foundation
Stable release 1.4.0[1] / July 12, 2012
Website x.org/wiki/Projects/XRandR
RandR is an extension to X11/Wayland. The device driver for the display controller, sits in the Linux kernel: KMS driver.

RandR ("resize and rotate") is a communications protocol written as an extension to the X11[2] and Wayland[3] protocols for display servers. Both XRandR and WRandR facilitate the ability to resize, rotate and reflect the root window of a screen.

A user can typically use applications with a graphical front-end provided by the desktop environment to control RandR, but the additional command line tools xrandr and weston-wrandr exist.

Limitations and criticisms of RandR

RandR 1.2 permits only one virtual screen per display device. It is not possible to assign each monitor on a device to a different screen (sometimes called "Zaphod" mode), or to combine monitors from multiple devices into a single screen.[4] One practical limiting effect of this is that it is not possible to run a different WM on each monitor, since window managers are limited to one per screen. Some of these specific issues are resolved in RandR 1.3.[5]

History

The initial X11 design did not anticipate the need for dynamic resizing and it was necessary to restart the X display server to bring about the changes. However, XFree86 has, since its first release, allowed the user to change the screen resolution on the fly without changing the desktop size. RandR extension framework brought the ability to change display characteristics without restarting the X session. The extension framework allows laptops and handheld computers to change their screen size to drive external monitors at different resolutions than their built in screens.[6]

Release history

RandR 1.3

Some of the features in version 1.3:[7]

RandR 1.4

Some of the features in 1.4:[9]

Examples

Calling xrandr without parameters outputs the current state of the output ports:

Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 345mm x 194mm
   1920x1080      60.0*+
   1400x1050      60.0  
   1280x1024      60.0  
   1280x960       60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
VGA1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 700mm x 394mm
   1280x720       50.0 +   60.0     59.9  
   1920x1080i     60.1*    50.0     60.0  
   1024x768       60.0  
   800x600        60.3  
   720x576        50.0  
   720x480        60.0     59.9  
DP2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
DP3 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

In this example, there are two monitors connected: one to "eDP1", which is a DisplayPort-Connector, and one to "HDMI1", which is a HDMI-Connector. The other outputs are detected as "disconnected". The current active modes for "eDP1" is a resolution of 1920x1080 at 60Hz, while "HDMI1" is at 1920x1080 pixels in "interlaced" mode (hence the "i" next to the resolution).

The position of the displays (see next section) is not immediately visible. The current resolution, for example "1920x1080+1920+0" for "eDP1" contains that information. In this example, the monitor's X-Position is shifted to the right by 1920 pixels -- the X-resolution of "HDMI1" -- which is "left-of" "eDP1". To aid with visualizing, there are tools like KRandRTray which show a graphical representation of the current setup. The preferred mode is denoted by the "+" sign next to a mode in the above xrandr output and is automatically selected when using "--auto", see the examples below.

Screen position

A common setup is to have one screen left or right of another screen. This example assumes that the output named "eDP1" is the primary screen, while VGA1 is a monitor that is placed on the left of "eDP1".

xrandr --output VGA1 --auto --left-of eDP1

The "--auto" parameter enables all connected but disabled outputs with their preferred mode (denoted by the "+" sign in the above xrandr output), because of that it is not always required to explicitly set parameters like resolution or refresh rate.

Disabling an ouput

Disabling an output requires the parameter "--off"

xrandr --output VGA1 --off

References

External links