Registered Member
|
How can I change the global scale* before launching the various processes that rely on it?
This is on KDE 5.24.6 as provided with Kubuntu 22.04.1. I change my global scale based on what monitor I'm using. If my external monitor is present, I want 150% scaling, otherwise 200%. Currently, this means logging in, changing the setting, logging out, and logging back in. I'd like to avoid the need need to log out and back in. Instead, I'm hoping to detect if the second monitor is present (I can do that), and adjust whatever settings need to be adjusted before the relevant KDE bits launch. I've tried setting "Save displays' properties" to "For only this specific display arrangement", but I don't think it impacts the Global scale, just the resolutions and monitor positioning. I tried adding "/usr/bin/su - alan /home/alan/bin/pre-plasma" to /usr/share/sddm/scripts/Xsetup. My pre-plasma script ultimately calls something like "kwriteconfig5 --group KScreen --key ScaleFactor 1.5" and 'kwriteconfig5 --group KScreen --key ScreenScaleFactors "eDP-1=1.5;DP-1=1.5;DP-2=1.5;DP-1-1=1.5;DP-1-2=1.5;DP-1-3=1.5;"' My script does get called as me, it does change the corresponding value in ~/.config/kdeglobals, and System Settings reports the value I've set. Unfortunately it doesn't seem to do anything, even across multiple logins. But if I go into System Settings and change the scaling to 175%, Apply, 150%, Apply, and log out and back, everything is 150% as I'd want, and the settings are the same. Given that, I don't think the problem is that Xsetup is too late, but that I'm changing at the wrong things or perhaps not enough things. "Doesn't seem to do anything" is a bit simplified, as something is changing. Visually it looks identical, but if I maximize Konsole and check the number of lines (tput lines), it does change. For example, configuring 150% manually and logging back in, the Konsole is 79 lines. 200% manually set gives me 58 lines. If it was manually set to 200%, then my script tried to set it to 150%, a full-screen Konsole is 60, suggesting that something is at least a bit smaller, but the fonts appear to be identical size to 200%. I am not looking for xrandr scaling based solutions, as that's a very different thing and generates blurry results. KDE's global scale does exactly what I want, I just want to change it before KDE gets going. * By global scale, I mean the setting found in System Settings > Display and Monitor > Global scale, which I believe is the same value as seen with "kreadconfig5 --group KScreen --key ScaleFactor". |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell