How to set a custom screen resolution in Ubuntu Wayland & Xorg

Ubuntu 21.04 uses Wayland as its default display server, so the previous method of using xrandr no longer works to add custom screen resolutions.

Therefore, this tutorial will show you another way to add your favorite screen resolution if it is not available in your display settings.

In this case, I’m using the default 1920X1080 (16: 9) resolution. However, I prefer 1600X900 (16: 9), which is not available in the settings.

Before you start:

In this tutorial, we will add a video mode option as a kernel parameter. The good thing is that it works on both Wayland and Xorg.

The drawbacks are:

  • You cannot set a custom resolution higher than the maximum resolution in the display settings. In my case (see image above), the X resolution should be less than 1920 and the Y resolution should be less than 1080.
  • If you are using a dual boot or multi boot system, the following steps may not work for “Other Linux” in the Grub boot menu. For example, your laptop has a dual boot of Ubuntu 21.04 and Ubuntu 20.04, and the startup boot menu is handled by Grub for Ubuntu 21.04. Ubuntu 21.04 is listed as the first menu entry, but in my case the custom kernel parameters don’t work on Ubuntu 20.04.

Then, after adding the parameters, the custom resolution will be displayed in the display settings. For example, 1600 x 900.

How to tell the display device name in Ubuntu:

First, you need to check the current display name. To do this, open a terminal from the System Application Launcher.

When the terminal opens, run the following command:

for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done

As the picture shows, it’s eDP-1 in my case.

How to add video mode kernel parameters:

Options 1.) Edit the Grub configuration file.

a. ) Open the terminal from the system app launcher. Once open, run the command to edit the configuration file.

sudo gedit /etc/default/grub

On Ubuntu-based systems, you can replace gedit with another text editor.

Once opened, add video = eDP-1: 1600 ×[email protected], In my case, as the value of “GRUB_CMDLINE_LINUX_DEFAULT”.

Important: video = eDP-1: Replaced 1600 ×[email protected]:

  • eDP-1 is the display device name. You can find it in the previous step.
  • A desirable screen resolution is 1600 x 900. Replace it with yours.
  • 60 is the refresh rate.It’s okay to skip it, so video = eDP-1: 1600 x 900

The video mode kernel parameters have many more flags. See documentation For more information.

b. Finally, run the command to apply the changes.

sudo update-grub

Then reboot.

Option 2.) Use the Grub customizer.

Grub-Customizer, a popular graphical tool, has the option to add kernel parameters.

If you don’t have it, install it from the Ubuntu software. Then launch it,[一般設定]Go to the tab. Finally add the value,[保存]Click the button.

Set custom resolutions for multiple displays.

If you have multiple monitors connected to your Ubuntu machine. You can set one screen resolution for all displays or use the additional “video =” parameter for each display.

a. ) To set one screen resolution for all displays, skip the device name. For example:

[email protected]

It adds a 1600×900 screen resolution and a 60Hz refresh rate to all connected displays.

b. ) Add the “video =” parameter. For example, two displays, eDP-1 and DP-1, are connected. To add 1360×700 to the eDP-1 and 1600×900 to the DP-1, use:

video=eDP-1:[email protected] video=DP-1:[email protected]

that’s all. pleasant!

Share this:

  • More

Related Posts