Manually add a resolution to Gnome with Wayland

7

2

I'm using Gnome on Arch Linux with VMWare.

When I go in the settings window, I cannot find my resolution (which is 1920x1080).

I was recently using LightDM and I added an entry in /etc/X11/xorg.conf.d with my resolution, but now I use GDM instead of LightDM and it seems like my configuration doesn't change anything because GDM is using Wayland (correct me if I'm wrong).

I could not find any way to do the same thing as I did for X11 but with Wayland.

So my question is how can we manually add a resolution in Wayland?

user615603

Posted 2016-10-21T19:25:02.123

Reputation:

Answers

6

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.

Nathan Wallace

Posted 2016-10-21T19:25:02.123

Reputation: 156

1wayland is new enough that support is probably a bit wonky. Also, in theory you can always do a one off boot parameter edit is needed, right? – Journeyman Geek – 2017-01-19T14:18:34.110

Yes, true -- I did a one-off boot parameter to test it before I added it to my boot-loader entry. Good point – Nathan Wallace – 2017-01-21T21:36:04.303