Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Thanks To Everyone: How to set the screen resolution for both the GNome Greeter And GNome Session!

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
dachshund-digital
Posts: 40
Joined: 2021-12-23 22:22

Thanks To Everyone: How to set the screen resolution for both the GNome Greeter And GNome Session!

#1 Post by dachshund-digital »

This is a thanks to everyone, that have contributed to this forum in various ways, which in turn has saved me, if not others, 100s of hours, or more, in frantic Google searches over the years! But I digress...

For a few years I have been looking for a consistent and persistent method to change the screen resolution for the GNOME greeter and GNOME desktop session, that is easy, should be somewhat version independent, at least going forward (maybe). The odd thing is that what works for say a virtual machine did not work on actual hardware. This was frustrating. In short, the specific hardware I was using seemed to refuse to honor grub resolution control, not keeping the payload (of grub) but in a virtual machine just worked! This clearly was a quirk with the video driver, in the virtual machine versus hardware. So my search continued, to find a way to keep the login screen resolution and the desktop session screen resolution consistent. Below is what appears to work on everything I have tested thus far, VMs, Raspberry Pi devices (running GNOME of course), a few PCs, etc.

In short, create a script that leverages cvt and xrandr, such as the one below. Note this script must use the correct display name, see cvt and xrandr documentation for details. In my case, for example, my (old) PC, has an ATI RAEDON 4290 (RS800 series) video adapter, oh, and I disabled XWayland, see the GNOME documentation for disable of XWayland.

Using cvt...

# cvt 1920 1080 60
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync

Using xrandr to display the monitor names
# xrandr

Now for the script that leverages xrandr...

Code: Select all

#!/bin/bash
#
#

xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA-0 1920x1080_60.00
xrandr --output VGA-0 --mode 1920x1080_60.00
Drop this script into a system wide shared location, say /usr/local/bin for example. Next, create desktop (launcher) files in the following directories below, of course using links to these directories and a single desktop file should work, but I was lazy in the initial setup.

Code: Select all

# nano /usr/share/gdm/greeter/autostart/set-resolution.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=False
Exec=/usr/local/bin/set-resolution.sh
Name=Set Greeter Resolution
Comment=Set Greeter Resolution
#Icon=

Code: Select all

# nano /etc/xdg/autostart/set-resolution.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=False
Exec=/usr/local/bin/set-resolution.sh
Name=Set Greeter Resolution
Comment=Set Greeter Resolution
#Icon=
Since I only have one monitor, I did not create configuration settings for any other monitors, if you have multiple monitors, it might make more sense to create a custom Xorg configuration file, which I will not discuss here.

There is one slight quirk to this method, the screen resolution changes between login completion and session creation, but since the screen is black the entire time, the only clue this is happening is that the cursor arrow changes size. I can live with this to be sure. The faster your system is the less noticeable this will be of course. On my older slower system, it appears for about 1 second or a bit more, if you are not looking for it, may even miss it.

To test, just exit the GNOME desktop session, and the login greeter should present at the desired resolution. Let me know if this works or not based on your experience, for me it works on Debian 11 using the default GNOME setup. Getting to this point, is again, thanks to the many that have helped me over the years!

Post Reply