Saturday, March 03, 2018

Manually set screen resolution for Ubuntu

install xrandr
$ sudo apt-get install xrandr

check current modes
$ xrandr
Screen 0: minimum 8 x 8, current 1360 x 768, maximum 32767 x 32767
DVI1 unknown connection 1360x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1360x768      59.80*+
VGA1 connected primary 1024x768+0+0 (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

find new mode to add
$ cvt 1360 768
# 1360x768 59.80 Hz (CVT) hsync: 47.72 kHz; pclk: 84.50 MHz
Modeline "1360x768_59.80"   84.50  1360 1432 1568 1776  768 771 781 798 -hsync +vsync

add new mode
$ xrandr --newmode "1360x768_59.80" 84.50  1360 1432 1568 1776  768 771 781 798 -hsync +vsync

check new mode
$ xrandr
Screen 0: minimum 8 x 8, current 1360 x 768, maximum 32767 x 32767
DVI1 unknown connection 1360x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1360x768      59.80*+
VGA1 connected primary 1024x768+0+0 (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 
   1360x768_59.80  59.62

set new mode
$ xrandr --output VGA1 --mode 1360x768_59.80 --auto