Linux command
xrandr 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Query
xrandr -q
Auto-configure
xrandr --auto
Example
xrandr --output DP1 --mode 1920x1080 -r 60
Example
xrandr --output HDMI2 --mode 1280x1024 --right-of DP1
Disable
xrandr --output VGA1 --off
Example
xrandr --output LVDS1 --brightness 0.5
Rotate
xrandr --output HDMI1 --rotate left
Mirror
xrandr --output HDMI1 --same-as LVDS1
说明
xrandr is used to set the size, orientation, and reflection of the outputs for an X screen. It can also set the screen size, add/remove modes, and change display properties dynamically without restarting X.
参数
- -q, --query
- Display current screen configuration
- --output OUTPUT
- Select output to configure
- --mode MODE
- Set resolution mode (WIDTHxHEIGHT)
- -r, --rate RATE
- Set refresh rate in Hz
- --pos XxY
- Set position of output
- --left-of OUTPUT
- Position left of specified output
- --right-of OUTPUT
- Position right of specified output
- --above OUTPUT
- Position above specified output
- --below OUTPUT
- Position below specified output
- --same-as OUTPUT
- Mirror specified output
- --rotate ROTATION
- Rotate output (normal, left, right, inverted)
- --reflect REFLECTION
- Reflect output (x, y, xy, normal)
- --brightness LEVEL
- Set brightness (0.0 to 1.0)
- --gamma R:G:B
- Set gamma correction
- --off
- Disable output
- --auto
- Enable output with preferred mode
- --primary
- Set as primary output
- -d, --display DISPLAY
- Specify X display to use
- --dpi DPI
- Set DPI for the screen
FAQ
What is the xrandr command used for?
xrandr is used to set the size, orientation, and reflection of the outputs for an X screen. It can also set the screen size, add/remove modes, and change display properties dynamically without restarting X.
How do I run a basic xrandr example?
Run `xrandr -q` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -q, --query do in xrandr?
Display current screen configuration