xrandr
不帶參數(shù)的xrandr 命令會列出系統(tǒng)支持的視頻接口名稱和設(shè)備連接情況,還可以從輸出信息里看到當(dāng)前分辨率current疙渣,以及支持的最大分辨率。
帶*的表示當(dāng)前分辨率堆巧。
$xrandr
Screen 0: minimum 8 x 8, current 1080 x 1920, maximum 32767 x 32767
DSI1 connected (normal left inverted right x axis y axis)
1024x600 60.00 +
1024x576 59.90 59.82
960x540 59.63 59.82
800x600 60.32 56.25
864x486 59.92 59.57
640x480 59.94
720x405 59.51 58.99
640x360 59.84 59.32
512x300 60.00
DP1 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected primary 1080x1920+0+0 right (normal left inverted right x axis y axis) 480mm x 270mm
1920x1080 60.00*+
1600x1200 60.00
1680x1050 59.88
1400x1050 59.95
1280x1024 75.02 60.02
1440x900 59.90
1280x960 60.00
1152x864 75.00
1024x768 75.03 70.07 60.00
832x624 74.55
800x600 72.19 75.00 60.32 56.25
640x480 75.00 72.81 66.67 59.94
720x400 70.08
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
1. 將視頻輸出發(fā)送到某個接口設(shè)備:
$ xrandr --output DFP1 --auto
2. 設(shè)置分辨率時需要指定設(shè)置的output及mode妄荔,如將LVDS-1的分辨率改為1920×1080,命令就是:
xrandr --output eDP1 --mode 1920x1080
--output:指定顯示器谍肤。
--mode:指定一種有效的分辨率啦租。
--rate:指定刷新率。
3. 添加有效分辨率
如果xrandr查詢結(jié)果中沒有合適的分辨率荒揣,則可以通過newmode來
添加篷角,下面將給出eDP1添加1280x1024x60的分辨率方法。
3.1 使用cvt生成一個modeline乳附,命令如下:
$cvt 1280 1024 60
#1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
3.2 使用newmode創(chuàng)建一個mode内地,參數(shù)就是上面的modeline后的內(nèi)容:
$xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
3.3 新建模式伴澄,將新模式添加至當(dāng)前輸出設(shè)備,如果出錯赋除,則說明不支持此模式
$xrandr --addmode eDP1 1280x1024_60.00
3.4 設(shè)置newmode為當(dāng)前分辨率
$xrandr --output eDP1 --mode 1280x1024_60.00
4 . 關(guān)閉某個接口設(shè)備的視頻輸出。
$ xrandr --output LVDS --off
5.設(shè)置雙屏幕顯示:
(1)打開外接顯示器非凌,雙屏幕顯示相同的內(nèi)容--克隆举农,(auto為最高分辨率)
xrandr --output VGA-0 --same-as DVI-D-0 --auto
(2)若要指定外接顯示器的分辨率可以使用下面的命令(1280*1024):
xrandr --output VGA-0 --same-as DVI-D-0 --mode 1280x1024
(3)打開外接顯示器,設(shè)置為右側(cè)擴展
xrandr --output VGA-0 --right-of DVI-D-0 --auto
(4)關(guān)閉顯示器
xrandr --output VGA-0 --off
(5)打開VGA-0接口顯示器敞嗡,關(guān)閉DVI-D-0接口顯示器
xrandr --output VGA-0 --auto --output DVI-D-0 --off
(6設(shè)置HDMI2為主屏幕
$ xrandr --output HDMI2 --auto --primary
(7) 設(shè)置eDp1在HDMI2的右面
$ xrandr --output eDP1 --right-of HDMI2 --auto