xrandr
Configure display resolution and orientation
TLDR
Display the current state of the system (known screens, resolutions, ...)
Disable disconnected outputs and enable connected ones with default settings
Change the resolution and update frequency of DisplayPort 1 to 1920x1080, 60Hz
Set the resolution of HDMI2 to 1280x1024 and put it on the right of DP1
Disable the VGA1 output
Set the brightness for LVDS1 to 50%
Display the current state of any X server
SYNOPSIS
xrandr [options]
PARAMETERS
-v
Show the xrandr version.
-q
Query the server for its current state. This is the default action when no other option is specified.
-s
Sets the screen size to
-r
Sets the refresh rate of the current screen to
-o
Sets the orientation of the screen. Valid options are normal, inverted, left, and right.
--output
Specifies the output (monitor) to configure. Use xrandr -q to list available outputs.
--mode
Sets the mode (resolution) for the specified output. Use xrandr -q to list available modes.
--pos
Sets the position of the specified output to (x, y) relative to the primary output.
--left-of
Positions the specified output to the left of the
DESCRIPTION
xrandr is a command-line tool for managing monitor configurations in X Window System environments, commonly used in Linux. It allows users to query the current display setup, add or remove monitors, change screen resolution, refresh rates, orientation (rotation), mirroring, and positioning of displays relative to each other.
xrandr reads the configuration from the X server and provides a comprehensive interface to dynamically adjust the display configuration without requiring restarting the X server.
This tool is particularly useful in multi-monitor setups, laptop docking/undocking situations, and situations where the default display settings need to be overridden. xrandr commands can be scripted for automated configuration changes.
CAVEATS
Changes made with xrandr are often not persistent across reboots unless the commands are added to startup scripts or display manager configuration files.
EXAMPLE USAGE
Example 1: List current display configuration: xrandr
Example 2: Set resolution of VGA1 to 1920x1080: xrandr --output VGA1 --mode 1920x1080
Example 3: Extend the display to the right of HDMI-0 : xrandr --output HDMI-0 --right-of eDP-1
HISTORY
xrandr was developed as part of the X Window System project to provide a dynamic configuration tool for displays. It evolved to handle the increasing complexity of multi-monitor setups and the need for on-the-fly configuration changes. It became a crucial part of desktop linux distributions.
SEE ALSO
xorg.conf(5), xdpyinfo(1)