Manually add a resolution to Gnome with Wayland
tldr -- On Gnome, you can set kernel boot parameter to manually override the resolution of your monitor. If you're using the Weston implementation (which apparently Gnome isn't), you can configure different resolutions in ~/.config/weston.ini
I struggled with this for a long time, and I've found a compromise that works okay for now. However, I hope there's a better way, so please let me know if there is.
With Weston (untested)
At first I thought Gnome used Weston for its Wayland layer, but apparently it doesn't work that way. If, however, you are using Weston, you can supposedly configure the resolution of external displays in ~/.config/weston.ini
:
[output]
name=VGA1
mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
The output name should be the name of your display. On Arch, you can run this command to find out what displays are connected:
for p in /sys/class/drm/*/status; do con=${p%/status}; echo -n "${con#*/card?-}: "; cat $p; done
To get the right value for the modeline, you can run cvt 1920 1080
, or with whatever resolution you need. More information here: https://wiki.archlinux.org/index.php/Wayland#Configuration
With Gnome
It seems that Gnome doesn't have a way to configure display resolutions (at least yet). So I found a bug report that referenced this kernel boot parameter you can use to override the resolution for displays. Read the linked documentation for full details, but on my system, I needed to configure the display "DP-1" to be 1920x1080 at 60Hz, so I added this line to my boot parameters:
video=DP-1:1920x1080@60
I'm using systemd-boot, so I added that to my options
line in /boot/loader/entries/arch.conf
. If you're using GRUB or anything else, your steps will be different for adding this boot parameter.
I'm actually not sure what will happen now if I boot with this option set and then plug in a display that needs a different resolution. Will this boot parameter override that, or is this a fallback for when automatic detection fails? I don't know. Because I'm not sure, I added a second boot entry that omits this parameter. So sometimes I may need to reboot to get the correct resolution on an external display. But otherwise, it's working fine.
This answer is a repeat of the accepted answer above with a specific focus on Gnome and an explanation of how to find the device name. I was trying to connect a second screen to my laptop under Debian GNU/Linux 10 (buster) with the Gnome desktop. The recommended resolution for that screen is 1920x1200. The issue was that the resolution was lower and there were only 2 options available in the setup menu:
Find device name
Devices can be seen in /sys/class/drm/
the available resolutions are visible in the modes file:
$ cat /sys/class/drm/card0-DP-2/modes
1024x768
800x600
800x600
848x480
640x480
$ cat /sys/class/drm/card0-eDP-1/modes
1920x1080
1920x1080
In my case the name of the screen in question is DP-2
.
Enter device name in boot parameter
On Ask Ubuntu, this answer explains how to add a new resolution to the kernel boot parameter.
sudo vim /etc/default/grub
Then edited this line
GRUB_CMDLINE_LINUX_DEFAULT="quiet video=DP-2:1920x1200@60"
Then update grub:
sudo update-grub
After a reboot, the new resolution becomes available: