Xrandr/zh-cn

RandR (Resize and Rotate) Article description::[[X 协议扩展及其 CLI 工具 用于管理屏幕分辨率、旋转和在 X 中多个屏幕的显示. ]].

With version 1.4 support for multiply graphics cards was introduced, future versions (>1.5) will also support monitors attached via USB (this will probably be merged with xorg-server 1.13 with support for DisplayLink ).

安装
The package can be installed with the following command:

GUI工具
有一些 GUI 工具可以使用. 以下是 Gentoo 支持的工具列表：


 * – Another XRandR GUI (an independent GUI tool)
 * – LXDE GUI interface to RandR extension

配置
A common way to execute X related scripts is the use of or  files in a user's home directory. Put the line of code for in one of these files and it will be executed on every X startup to make settings permanent.

用法
uses the monitors Extended Display Identification Data (EDID) to identify its capabilities. Faulty hardware might report wrong or bad EDIDs, in those cases it is still possible to use custom made setups by trial and error.

屏幕查询
Running without any arguments will list all available display output interfaces and display devices along with their current state and capabilities:

A query result contains all available interfaces labeled as. Each shows its connection status and the reported screen modes. The connected device's current mode is hinted by, the preferred mode is hinted by.

The RandR naming scheme for common display interfaces:


 * - Laptop screen
 * - High-Definition Multimedia Interface
 * - Digital Visual Interface
 * - DisplayPort
 * - Video Graphics Array
 * - Composite Video
 * - S-Video

Screen manipulation
It is possible to manipulate output interfaces discovered via a query. Examples of common tasks:


 * Set the primary display if more than one device is attached:




 * Extend to an external display attached on a known interface (left-of, right-of, above, below, same-as):




 * Rotate a display (normal, left, right, inverted):




 * 关闭设备：



屏幕模式
A mode always consists of a resolution and a refresh-rate. With a query the hardware reports which modes are supported. It is possible to define own modes in case the hardware reports wrong information. To change the mode for an attached device:

It will use the highest refresh-rate in that mode, to also change the refresh-rate (in kHz):

The changes apply immediately and on the hardware listed above it might either produce an error or the screen goes blank, because 75kHz is not supported. This will last until the next session, using ++ will terminate the session and restart X in case something goes wrong.

To add a 75Hz mode, the tool  can be used to get a proper modeline:

Everything after Modeline needs to be appended to the following command:

Running the query again should list the newly added mode.

External resources

 * xrandr man page