Add custom resolution to Wayland if xrandr is not working, which mostly works for Xorg sessions

This is more to help my future forgetful self and anyone else who might have been looking to add a custom resolution to Wayland sessions, but this method also works on Xorg, though at the time of writing this I have not personally tested it on Xorg.

From my searching, the most common method I could find was the use of xrandr which for the most part worked to add the resolution temporally to my system but I could not save and use it. I later found out that xrandr only works under Xorg. Lets jump into it in 4 quick terminal steps.

  1. Confirm the connector name
    xrandr --listmonitors This will give you a list of connected monitors and ports used. In my case, I was doing this on my laptop with an external monitor connected via VGA. When the command xrandr --listmonitors is run in the terminal it lists:

Monitors: 2
0: +*LVDS-1 1366/310x768/170+0+263 LVDS-1
1: +VGA-1 768/203x1024/271+1366+0 VGA-1

  1. Now that we have the connector, we can add the video mode as a kernel parameter with sudo grubby --update-kernel=ALL --args="video=CONNECTOR:RESOLUTION". Replace CONNECTOR and RESOLUTION with the actual values you want to add so that, in my case, CONNECTOR becomes VGA-1 and RESOLUTION becomes 1280x1024@60 Note: the @60 is the refresh rate the monitor will use. The full command should look something like this: sudo grubby --update-kernel=ALL --args="video=VGA-1:1280x1024@60".
    This tells the kernel to generate a CVT-timed 1280x1024@60 mode for the connector, in this case VGA-1, before any display server (X11 or Wayland) even starts, so it’s available regardless of session type.

  2. Reboot.
    For the addition to take effect reboot the system, either using the terminal commands reboot / sudo reboot or your system GUI power options → Reboot, will work.

  3. Check that it took
    When your system boots back up and you log back in, check your display settings, in the case of Gnome, this can be done by going to Settings → Displays or right click on the empty space of your desktop select Display Settings. Select the monitor from the list of connected monitors and under resolution list of that monitor, you should see the new resolution you just added is now available. Select it and enjoy.

Note: If for some reason the resolution still doesn’t show up in the list. Verify you added it to the right connector and note that the video= parameter uses the standard CVT timings, which in most cases does not give an issue, but some monitors are picky about exact timings. If that’s the case, the fallback is a custom EDID binary. I don’t know much about this for I didn’t dive deeper into it, for the above method worked well for me. But from what I could find is that the EDID method lets you specify the exact modeline (including reduced blanking, etc.) rather than a kernel-generated approximation, which makes this a more complex method of decode/edit the monitor’s real EDID with edid-decode and a hex editor or a tool like wxEDID, worth researching more on if all the other methods fail.

1 Like