Add a custom resolution to your display using xrandr on Ubuntu 18.04

Just in case your monitor’s supported resolution is not properly detected or if you want a custom resolution to be used:

In this example, we will try to add 1368×768, with a refresh rate of 60

Run cvt to get the parameters of that resolution on your monitor (if it is supported):

cvt 1368 768 60

It gives you an output like the following

# 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
Modeline "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync

Copy the text starting from the double quotes till the end of the full output and add it to the xrandr command to create a new mode, as follows:

xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync 
+vsync

Finally we add that mode to the existing list, using the line in double quotes in the previous output:

xrandr --addmode eDP-1 "1368x768_60.00"

To apply that resolution via command line:

xrandr --output HDMI-1 --mode 1366x768 --rate 60

Where HDMI-1 is the screen output you want to apply on. To know the names you have available and connected, just run the command:

xrandr --query

In my situation, I have the following ones connected DP-1, eDP-1 while HDMI-1, HDMI-2 and DP-2 as disconnected (not hooked to a screen).

To make that persistent, please follow the first link in the sources section.

Enjoy!

Sources:

About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Linux and tagged , , , , . Bookmark the permalink.

1 Response to Add a custom resolution to your display using xrandr on Ubuntu 18.04

  1. Scott says:

    X Error of failed request: BadMatch (invalid parameter attributes)

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s