xrandr
systemLinux/Unix
The xrandr command is one of the most frequently used commands in Linux/Unix-like operating systems. xrandr Command line interface to X RandR extension for screen resolution and display configuration
Quick Reference
Command Name:
xrandr
Category:
system
Platform:
Linux/Unix
Basic Usage:
xrandr [options] [arguments]
Common Use Cases
Syntax
xrandr [options] [--output output] [output-options]
Options
General Options
Option | Description |
---|---|
--verbose |
Display detailed information |
--dryrun |
Test the configuration without applying it |
--screen <screen> |
Select which X screen to use |
--q, --query |
Display current state (the default) |
--version |
Display the version of xrandr |
Output Options
Option | Description |
---|---|
--output <output> |
Specify which output to configure |
--auto |
Automatically configure the specified output with preferred mode |
--mode <mode> |
Specify the mode (resolution) to use |
--rate <rate>, --refresh <rate> |
Specify the refresh rate to use |
--pos <x>x<y> |
Specify absolute position of the output |
--rotate <rotation> |
Specify the rotation (normal, left, right, inverted) |
--reflect <reflection> |
Specify the reflection (normal, x, y, xy) |
--primary |
Set this output as the primary display |
--off |
Disable the specified output |
--crtc <crtc> |
Specify the CRTC to use |
--panning <w>x<h>[+<x>+<y>[/<track:w>x<h>+<x>+<y>[/<border:l,t,r,b>]]] |
Set panning parameters |
--scale <x>x<y> |
Set output scaling factors |
--transform <a,b,c,d,e,f,g,h,i> |
Set transformation matrix |
--filter <nearest|bilinear> |
Set scaling filter |
Relative Position Options
Option | Description |
---|---|
--left-of <output> |
Place this output to the left of another output |
--right-of <output> |
Place this output to the right of another output |
--above <output> |
Place this output above another output |
--below <output> |
Place this output below another output |
--same-as <output> |
Make this output a clone of another output |
Mode Management Options
Option | Description |
---|---|
--fb <width>x<height> |
Set screen size (framebuffer) |
--fbmm <width>x<height> |
Set physical screen size in mm |
--dpi <dpi> |
Set screen DPI |
--newmode <name> <clock> <hdisp> <hsync-start> <hsync-end> <htotal> <vdisp> <vsync-start> <vsync-end> <vtotal> [flags...] |
Add a new mode (custom resolution) |
--rmmode <name> |
Remove a mode |
--addmode <output> <name> |
Add a mode to an output's available modes |
--delmode <output> <name> |
Remove a mode from an output's available modes |
Examples
How to Use These Examples
The examples below show common ways to use the xrandr
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
# Show current state of displays
xrandr