Using xrandr to Add Screen Resolution

This article help to add new resolution using xrandr in X11. We start from confirming the supported video mode in the display device.

Using xrandr to add custom video mode (screen resolution)

Please follow below steps to add the custom video mode

1. Check current display name and available video mode

Enter below command in terminal ..

1
2
3
4
5
6
7
$ xrandr | grep maximum
Screen 0: minimum 240 x 240, current 1280 x 720, maximum 8192 x 8192
DISP3 BG connected 1280x720+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
S:1920x1080p-60 60.0+
S:1920x1080p-50 50.0
S:1280x720p-50 50.0*
S:1280x720p-60 60.0

from above, we get:

  • display output name: “DISP3 BG”
  • current video mode: “S:1280x720p-50”
  • maximum resolution: 8192 x 8192
    And it is also easy to see that current resolution is 1280 x 720

The result might vary depends on your display device (We are using AOC I2470Sw - 24” HDMI monitor).

2. Create custom video mode

Use gtf to create the video mode line

1
2
3
4
$ gtf 800 480 60.0
# 800x480 @ 60.00 Hz (GTF) hsync: 29.82 kHz; pclk: 29.58
Modeline "800x480_60.00" 29.58 800 816 896 992 480 481 484 497 -HSync +Vsync

Add new mode using xrandr

1
$ xrandr --newmode "800x480_60.00" 29.58 800 816 896 992 480 481 484 497 -HSync +Vsync

Add this custom video mode to the output (display output name in step 1) and test

1
2
$ xrandr --addmode "DISP3 BG" 800x480_60.00
$ xrandr --output "DISP3 BG" --mode 800x480_60.00

3. Keep the configuration

Too keep the configuration, we could add teh “Modeline” into xorg.conf

sudo nano /etc/X11/xorg.conf

You could change nano to your familiar editor (ex: vi, vim or GUI-editor gedit, geany)

Try to find Section "Monitor" and insert below line into Monitor Section. Modeline "800x480_60.00" 29.58 800 816 896 992 480 481 484 497 -HSync +Vsync

for example:

1
2
3
4
5
6
Section "Monitor"
Identifier "HDMI Monitor"
...
Modeline "800x480_60.00" 29.58 800 816 896 992 480 481 484 497 -HSync +Vsync
...
EndSection

Reboot or restart X-server to take effect.

Reference

  1. modedb default video mode support - linux kernel documentation
  2. resolution - ubuntu wiki