2018-08-08

Linuxで外部モニターの解像度を指定して表示させる

PC:ThinkPad X230
OS:Ubuntu MATE 18.04LTS
モニター:BUFFALOのWUXGAのモニター(D-Sub接続)

とりあえず繋いでみたらWUXGAのモニターなのにXGAで表示しやがったのでなんとかする。
手順は何から何までこちら参照。

外部モニターを設定しようとするとこんな感じ。
  • ミラーリングで表示される
  • 解像度はXGAが最高
この状態でもミラーリングを解除すれば別表示にはできるけども…
  • やっぱり解像度はXGAが最高
現在のモニター設定を確認
$ xrandr
Screen 0: minimum 320 x 200, current 1366 x 1536, maximum 8192 x 8192
LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm
   1366x768      60.00*+
   1360x768      59.80    59.96  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   800x512       60.17  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   720x450       59.89  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   680x384       59.80    59.96  
   640x400       59.88    59.98  
   576x432       60.06  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
VGA-1 connected 1024x768+0+768 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      60.00* 
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
HDMI-3 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
どうやらLVDS-1とVGA-1が認識されていて、VGA-1は1024x768が適用されているらしい。cvtというコマンドで解像度に対応する文字列を出す。

$ cvt 1920 1200
# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz
Modeline "1920x1200_60.00"  193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync
cvtコマンドの結果をVGA-1に追加

$ xrandr --newmode "1920x1200_60.00" 193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync
$ xrandr --addmode VGA-1 1920x1200_60.00
解像度の1024x768の上に1920x1200が追加されるのでそれっぽくして反映できることを確認。
で、このままではXのセッションを抜ける度に設定が消えるので、xrandrコマンドをログイン時に反映するために~/.profileとかに追記する。

xrandr --newmode "1920x1200_60.00" 193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync
xrandr --addmode VGA-1 1920x1200_60.00
xrandr --output VGA-1 --mode 1920x1200_60.00
最後のxrandr --outputはVGA-1を1920x1200_60.00で表示するようにする。これでXのログイン後に外部モニターはWUXGAで表示されることを確認。

1 件のコメント: