XRANDR(1)
okay bestie ๐ welcome to XRANDR(1) โ X Version 11 โ the manual for xrandr, aka the thing that adjusts the size, orientation, and reflection of a screen using the RandR extension. slay.
๐ธ NAME ๐ธ
xrandr โ adjust size, orientation, reflection of a screen (using RandR extension)
โจ SYNOPSIS โจ
okay so the whole vibe is:
xrandr [--help] [--display display] [-q] [-v] [--verbose] [--dryrun]
[--screen snum] [--q1] [--q12] [--current] [--noprimary]
[--panning widthxheight[+x+y[/track_widthxtrack_height+track_x+track_y[/border_left/border_top/border_right/border_bottom]]]]
[--scale x[xy]] [--scale-from wxh] [--transform a,b,c,d,e,f,g,h,i]
[--primary] [--prop] [--fb widthxheight] [--fbmm widthxheight]
[--dpi dpi] [--dpi from-output]
[--newmode name mode] [--rmmode name] [--addmode output name]
[--delmode output name] [--output output] [--auto] [--mode mode]
[--preferred] [--pos xxy] [--rate rate]
[--reflect reflection] [--rotate orientation]
[--left-of output] [--right-of output]
[--above output] [--below output] [--same-as output]
[--set property value] [--off] [--crtc crtc]
[--gamma red[:green:blue]] [--brightness brightness]
[-o orientation] [-s size] [-r rate] [-x] [-y]
[--listproviders] [--setprovideroutputsource provider source]
[--setprovideroffloadsink provider sink]
[--listmonitors] [--listactivemonitors]
[--setmonitor name geometry outputs] [--delmonitor name]
๐ DESCRIPTION ๐
Xrandr is used to set the size, orientation, and/or reflection of the outputs for a screen. It can also set the size of the overall screen.
If you invoke it without any option, it will dump the state of the outputs, showing the existing modes for each of them, with a + after the preferred modes and a * after the current mode.
There are a few global options. Other options modify the last output that is specified in earlier parameters in the command line. Multiple outputs may be modified at the same time by passing multiple --output options followed immediately by their corresponding modifying options.
--helpโ Print out a summary of the usage and exit.-v,--versionโ Print out the RandR version reported by the X server and exit.--verboseโ Causesxrandrto be more verbose. When used with-q(or without other options),xrandrwill display more information about the server state. Please note that the gamma and brightness information are only approximations of the complete color profile stored in the server. When used along with options that reconfigure the system, progress will be reported while executing the configuration changes.-q,--queryโ When this option is present, or when no configuration changes are requested,xrandrwill display the current state of the system.--dryrunโ Performs all the actions specified except that no changes are made.--nograbโ Apply the modifications without grabbing the screen. It avoids blocking other applications during the update but it might also cause some applications that detect screen resize to receive old values.-d,--displayname โ This option selects the X display to use. Note this refers to the X screen abstraction, not the monitor (or output).--screensnum โ This option selects which screen to manipulate. Note this refers to the X screen abstraction, not the monitor (or output).--q1โ Forces the usage of the RandR version 1.1 protocol, even if a higher version is available.--q12โ Forces the usage of the RandR version 1.2 protocol, even if the display does not report it as supported or a higher version is available.
โจ RandR version 1.5 options โจ
Options for RandR 1.5 are used as a superset of the options for RandR 1.4.
--listmonitorsโ Report information about all defined monitors.--listactivemonitorsโ Report information about currently active monitors.--setmonitorname geometry output-list โ Define a new monitor with the given geometry and associated to the given outputs. The output-list is either the keywordnoneor a comma-separated list of outputs. The geometry is either the keywordauto, in which case the monitor will automatically track the geometry of the associated outputs, or a manual specification in the formw/mmwxh/mmh+x+ywherew,h,x,yare in pixels andmmw,mmhare the physical dimensions of the monitor.--delmonitorname โ Delete the given user-defined monitor.
๐ RandR version 1.4 options ๐
Options for RandR 1.4 are used as a superset of the options for RandR 1.3.
--listprovidersโ Report information about the providers available.--setprovideroutputsourceprovider source โ Set source as the source of display output images for provider. This is only possible if source and provider have the Source Output and Sink Output capabilities, respectively. If source is0x0, then provider is disconnected from its current output source.--setprovideroffloadsinkprovider sink โ Set provider as a render offload device for sink. This is only possible if provider and sink have the Source Offload and Sink Offload capabilities, respectively. If sink is0x0, then provider is disconnected from its current render offload sink.
๐ฆ RandR version 1.3 options ๐ฆ
Options for RandR 1.3 are used as a superset of the options for RandR 1.2.
--currentโ Return the current screen configuration, without polling for hardware changes.--noprimaryโ Don't define a primary output.
๐ Per-output options ๐
--panning widthxheight[+x+y[/track_widthxtrack_height+track_x+track_y[/border_left/border_top/border_right/border_bottom]]]โ This option sets the panning parameters. As soon as panning is enabled, the CRTC position can change with every pointer move. The first four parameters specify the total panning area, the next four the pointer tracking area (which defaults to the same area). The last four parameters specify the border and default to 0. A width or height set to zero disables panning on the according axis. You typically have to set the screen size with--fbsimultaneously.--transform a,b,c,d,e,f,g,h,iโ Specifies a transformation matrix to apply on the output. A bilinear filter is selected automatically unless the--filterparameter is also specified. The mathematical form corresponds to:
a b c
d e f
g h i
The transformation is based on homogeneous coordinates. The matrix multiplied by the coordinate vector of a pixel of the output gives the transformed coordinate vector of a pixel in the graphic buffer. More precisely, the vector (x y) of the output pixel is extended to 3 values (x y w), with 1 as the w coordinate and multiplied against the matrix. The final device coordinates of the pixel are then calculated with the so-called homogenic division by the transformed w coordinate. In other words, the device coordinates (x' y') of the transformed pixel are:
x' = (ax + by + c) / w' and
y' = (dx + ey + f) / w' ,
with w' = (gx + hy + i) .
Typically, a and e corresponds to the scaling on the X and Y axes, c and f corresponds to the translation on those axes, and g, h, and i are respectively 0, 0 and 1. The matrix can also be used to express more complex transformations such as keystone correction, or rotation. For a rotation of an angle T, this formula can be used:
cos T -sin T 0
sin T cos T 0
0 0 1
As a special argument, instead of passing a matrix, one can pass the string none, in which case the default values are used (a unit matrix without filter).
--filterfiltermode โ Chooses the scaling filter method to be applied when the screen is scaled or transformed. Can be either'bilinear'or'nearest'.--scale x[xy]โ Changes the dimensions of the output picture. If theyvalue is omitted, thexvalue will be used for both dimensions. Values larger than 1 lead to a compressed screen (screen dimension bigger than the dimension of the output mode), and values less than 1 lead to a zoom in on the output. This option is actually a shortcut version of the--transformoption.--scale-from wxhโ Specifies the size in pixels of the area of the framebuffer to be displayed on this output. This option is actually a shortcut version of the--transformoption.--primaryโ Set the output as primary. It will be sorted first in Xinerama and RANDR geometry requests.
๐ RandR version 1.2 options ๐
okay so these options are only available for an X server supporting RandR version 1.2 or newer. No cap. ๐
--prop,--propertiesโ this makesxrandrdisplay the contents of properties for each output. Also,--verboseenables--prop, so it's giving sneaky little two-for-one. โจ--fbwidthxheight โ reconfigures the screen to the specified size. All configured monitors must fit within this size. When this option is not provided,xrandrcomputes the smallest screen size that will hold the set of configured outputs; this option provides a way to override that behaviour. ๐ซถ--fbmmwidthxheight โ sets the value reported as physical size of the X screen as a whole (union of all configured monitors). In configurations with multiple monitors with different DPIs, the value has no physical meaning, but it may be used by some legacy clients which do not support RandR version 1.2 to compute a reference font scaling. Normally,xrandrresets the reported physical size values to keep the DPI constant. This overrides that computation. Default DPI value is96. ๐--dpidpi /--dpifrom-output โ this also sets the value reported as physical size of the X screen as a whole (union of all configured monitors). In configurations with multiple monitors with different DPIs, the value has no physical meaning, but it may be used by some legacy clients which do not support RandR version 1.2 to compute a reference font scaling. This option uses either the specified DPI value, or the DPI of the given output, to compute an appropriate physical size using whatever pixel size will be set. Typical values are the default (96DPI), the DPI of the only monitor in single-monitor configurations, or the DPI of the primary monitor in multi-monitor configurations. ๐ธ--newmodename mode โ new modelines can be added to the server and then associated with outputs. This option does the former. The mode is specified using theModeLinesyntax forxorg.conf:clock hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal flags.flagscan be zero or more of+HSync,-HSync,+VSync,-VSync,Interlace,DoubleScan,CSync,+CSync,-CSync. Several tools compute the usual modeline from a height, width, and refresh rate, for instance you can usecvt(1). ๐ฅ--rmmodename โ this removes a mode from the server if it is otherwise unused. Bye-bye, unused mode. ๐--addmodeoutput name โ add a mode to the set of valid modes for an output. ๐--delmodeoutput name โ remove a mode from the set of valid modes for an output. ๐ซถ
๐ Per-output options ๐
--outputoutput โ selects an output to reconfigure. Use either the name of the output or the XID. ๐--autoโ for connected but disabled outputs, this will enable them using their first preferred mode (or something close to96dpi if they have no preferred mode). For disconnected but enabled outputs, this will disable them. โจ--modemode โ this selects a mode. Use either the name or the XID for mode. ๐--preferredโ this selects the same mode as--auto, but it doesn't automatically enable or disable the output. ๐ธ--posxxy โ position the output within the screen using pixel coordinates. In case reflection or rotation is applied, the translation is applied after the effects. ๐ฆ--raterate โ this marks a preference for refresh rates close to the specified value. When multiple modes have the same name, this will select the one with the nearest refresh rate. โญ--reflectreflection โ reflection can be one ofnormal,x,y, orxy. This causes the output contents to be reflected across the specified axes. โจ--rotaterotation โ rotation can be one ofnormal,left,right, orinverted. This causes the output contents to be rotated in the specified direction.rightspecifies a clockwise rotation of the picture andleftspecifies a counter-clockwise rotation. ๐ฅ--left-of,--right-of,--above,--below,--same-asanother-output โ use one of these options to position the output relative to the position of another output. This allows convenient tiling of outputs within the screen. The position is always computed relative to the new position of the other output, so it is not valid to say--output a --left-of b --output b --left-of a. ๐--setproperty value โ sets an output property. Integer properties may be specified as a valid (see--prop) comma-separated list of decimal or hexadecimal (with a leading0x) values. Atom properties may be set to any of the valid atoms (see--prop). String properties may be set to any value. ๐--offโ disables the output. ๐--crtccrtc โ uses the specified crtc (either as an index in the list of CRTCs or XID). In normal usage, this option is not required asxrandrtries to make sensible choices about which crtc to use with each output. When that fails for some reason, this option can override the normal selection. ๐--gammared[:green:blue] โ set the specified floating point values as gamma correction on the crtc currently attached to this output. If green and blue are not specified, the red value will be used for all three components. Note that you cannot get two different values for cloned outputs (i.e., outputs which share the same crtc) and that switching an output to another crtc doesn't change the crtc gamma corrections at all. ๐--brightnessbrightness โ multiply the gamma values on the crtc currently attached to the output to specified floating value. Useful for overly bright or overly dim outputs. However, this is a software only modification, if your hardware has support to actually change the brightness, you will probably prefer to usexbacklight(1). ๐ฅ
๐ฆ RandR version 1.1 options ๐ฆ
These options are available for X servers supporting RandR version 1.1 or older. They are still valid for newer X servers, but they don't interact sensibly with version 1.2 options on the same command line. Ngl, keep them in separate lanes. ๐
-s,--sizesize-index or--sizewidthxheight โ this sets the screen size, either matching by size or using the index into the list of available sizes. ๐-r,--rate,--refreshrate โ this sets the refresh rate closest to the specified value. โญ-o,--orientationrotation โ this specifies the orientation of the screen, and can be one ofnormal,inverted,left, orright. ๐-xโ reflect across the X axis. โจ-yโ reflect across the Y axis. โจ
๐ EXAMPLES ๐
okay bestie, these are the little scenarios where the flags come together and it's giving main character energy. โจ
Sets an output called LVDS to its preferred mode, and on its right put an output called VGA to set to the preferred mode of a screen which has been physically rotated clockwise:
xrandr --output LVDS --auto --rotate normal --pos 0x0 \
--output VGA --auto --rotate left --right-of LVDS
Forces to use a 1024x768 mode on an output called VGA:
xrandr --newmode "1024x768" \
63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
xrandr --addmode VGA 1024x768
xrandr --output VGA --mode 1024x768
Enables panning on a 1600x768 desktop while displaying 1024x768 mode on an output called VGA:
xrandr --fb 1600x768 --output VGA --mode 1024x768 \
--panning 1600x0
Have one small 1280x800 LVDS screen showing a small version of a huge 3200x2000 desktop, and have a big VGA screen display the surrounding of the mouse at normal size:
xrandr --fb 3200x2000 --output LVDS --scale 2.5x2.5 \
--output VGA --pos 0x0 \
--panning 3200x2000+0+0/3200x2000+0+0/64/64/64/64
Displays the VGA output in trapezoid shape so that it is keystone corrected when the projector is slightly above the screen:
xrandr --fb 1024x768 --output VGA \
--transform 1.24,0.16,-124,0,1.24,0,0,0.000316,1
๐ XWAYLAND ๐
Xwayland(1) is an X server that uses a Wayland Compositor as backend. Xwayland acts as translation layer between the X protocol and the Wayland protocol but does not have direct access to the hardware. With Xwayland rootless (the default with most Wayland compositors), RandR is emulated and only available read-only to report the current status and configuration of the outputs as exposed to X11 clients. As a result, it is not possible to change the configuration of the outputs using xrandr on a Wayland environment with Xwayland running rootless. ๐ญ
โญ SEE ALSO โญ
Xrandr(3)cvt(1)xkeystone(1)xbacklight(1)
๐ AUTHORS ๐
Keith Packard, Open Source Technology Center, Intel Corporation. and Jim Gettys, Cambridge Research Laboratory, HP Labs, HP. ๐ซถ
๐ that's the whole page, bestie โ this XRANDR(1) page is from xrandr 1.5.4, dated 2025-04-15. go slay your outputs ๐
โจ
๐ฆ where this page comes from
- alpine 3.24: xrandr-doc 1.5.4-r0 ยท MIT
- arch rolling: xorg-xrandr 1.5.4-1 ยท HPND-sell-variant
- nixos 26.05: xrandr 1.5.4
- nixpkgs unstable: xrandr 1.5.4
- Copyright 2001 Keith Packard
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms