Xrandr Command
The xrandr command is a powerful utility for configuring screen resolutions, output connections, and monitor arrangements in Linux environments that use the X Window System. It allows users to dynamically change screen settings without needing to restart the graphical session.
Configure Display Outputs
xrandr is essential for managing multiple monitors, setting primary displays, and adjusting refresh rates. Understanding its syntax is key to optimizing your desktop workspace.
Enable HDMI Output
To enable an HDMI output and automatically detect the best resolution, use the --auto option. This is a common first step when connecting a new display.
# To enable HDMI2 output with maximal resolution:
xrandr --output HDMI2 --auto
Set Specific Resolution
If you need to enforce a particular screen resolution, you can specify it using the --mode option. This is useful for compatibility or when automatic detection isn't ideal.
# To enable HDMI2 output with specific resolution:
xrandr --output HDMI2 --mode 1280x800
Arrange Monitors
Positioning multiple monitors relative to each other is easily achieved with xrandr. Options like --right-of, --left-of, --above, and --below help create a seamless multi-monitor setup.
# To enable HDMI2 output next to HDMI1 output:
xrandr --output HDMI2 --auto --right-of HDMI1
Disable Output
When a display is no longer needed, you can disable it to save power or simplify your setup.
# To disable HDMI2 output:
xrandr --output HDMI2 --off
Further Display Management
xrandr offers many more options for advanced users, including setting primary displays, mirroring screens, and configuring refresh rates. For detailed information, consult the official documentation.
External Resources: