How to scale the Plasma login screen on HD/UHD screens

Updated: September 17, 2021

Life problems come in many shapes and forms. One of them could be the login screen in your Plasma desktop. How? By not scaling up to the selected screen resolution of your system. Case in point, my recent endeavor with Kubuntu 20.04 on my IdeaPad Y50-70, with its Nvidia card and 4K screen. Long story short, while I managed to get the desktop resolution and UHD scaling just right, the login screen did not obey my settings, and only rendered in 4K, ergo tiny.

I spent a lot of time trying to fix this, and finally, came up with this guide. Now, in newer editions of Plasma, like say 5.20, where scaling works really great, you might not face this issue at all. In 5.18.5, I had to resort to a few ugly tricks to get everything working. Let's see what gives.

Problem in more detail

The login screen details feels too small, because they are rendered in 4K on a tiny device. Scaling the desktop and/or changing its resolution helps, including the lock screen but NOT the login screen (SDDM). The fix is to make SDDM render itself at a different resolution during startup.

Solution

SDDM scripts are located under: /usr/share/sddm/scripts/. The script that controls the graphical component is called Xsetup. By default, this script may include some information, specific to your graphics driver. What you need to do is add an entry that will make SDDM display at a different resolution.

Open the file in a text editor as sudo or root (back it up of course), and add this line:

xrandr --output "device" --mode "mode" --rate "rate"

As you guessed right, this is only relevant for X11 and not Wayland, but then, most distros use X anyway, including Kubuntu 20.04 LTS, plus Nvidia drivers. So it's X for us. Now, we need to figure out the device, mode and rate for the command.

Detect display settings

Open a terminal window and run xrandr. This will show you all the supported modes for your monitor.

xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   3840x2160     48.00 +
   3200x1800     59.96    59.94 
   2880x1620     59.96    59.97 
   2560x1600     59.99    59.97 
   2560x1440     59.99    59.99    59.96    59.95 
   2048x1536     60.00 
   1920x1440     60.00 
   1856x1392     60.01 
   1792x1344     60.01 
   2048x1152     59.99    59.98    59.90    59.91 
   1920x1200     59.88    59.95 
   1920x1080     60.01    59.97    59.96    59.93*
   1600x1200     60.00 
   1680x1050     59.95    59.88 
   1600x1024     60.17
... 

In my example, the device is eDP-1-1. The available resolutions go all the way up to 4K. The selected one is marked with asterisk. And then, you also have the different screen refresh rates in Hz. We know that the 4K resolution makes everything too tiny, so we want something smaller. I decided to go for 1080p, like the desktop itself. In my case, the matching refresh rate was 59.93 Hz. Thus, the xrandr command becomes:

xrandr --output eDP-1-1 --mode 1920x1080 --rate 59.93

Save the file, and reboot your system. Your login screen should look great now.

Conclusion

There we go. I think this is a pretty arcane tutorial, because it deals with something you would not necessarily consider important for day-to-day work. But then, if you have an HD/UHD monitor of small physical dimensions, you will probably need to up the scale or down the resolution (or both). For me, system changes were not reflected in the login screen in Plasma, and I had to make a manual adjustment.

This can be done with xrandr - you can use the tool to manage display resolutions regardless, and it's a nifty and powerful tool. The best part about the fix is that it's modular and fully reversible. It does not affect your logged in desktop (you can do that by providing a DPI settings if you want), and if you don't like it, just change or remove the entry from Xsetup, and you're done. Hopefully, this helps calm your OCD demons.

Cheers.