Skip to content

Create a custom graphics mode with xrandr

Sometimes not all available resolution modes are accessible by Xorg. Fixing this is a simple matter of using xrandr to create a new mode:

Input:

xrandr

Output:

Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 8192 x 8192
eDP-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   3840x2160     59.98*+
   2048x1536     60.00  
   1920x1440     60.00  
   1856x1392     60.01  
   1792x1344     60.01  
   1600x1200     60.00  
   1400x1050     59.98  
   1280x1024     60.02  
   1280x960      60.00  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   800x600       60.00    60.32    56.25  
   700x525       59.98  
   640x512       60.02  
   640x480       60.00    59.94  
   512x384       60.00  
   400x300       60.32    56.34  
   320x240       60.05  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)

As you can see we are missing a very useful 1920x1080 resolution mode on our laptop screen eDP-1. So, let’s see what it will take to add it:
Input:

cvt 1920 1080

Output:

# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

Now we can use that modeline line to create a new /etc/X11/xorg.conf.d/10-monitor.conf file, and make that resolution mode permanent:

Section "Monitor"
    Identifier "eDP-1"
    Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
EndSection
Published inDevelopment

Be First to Comment

Leave a Reply