plasma-dpi-switcher
plasma-dpi-switcher copied to clipboard
applying profile without logging out / killing session
If I understand the code correctly (which I might not!), it needs to end the current KDE session before changes can become effective in the next session. Meaning, all programs close. Yes, KDE resumes the session with most of the programs re-opening as they were. But for instance I get off my desk in the middle of a video conference... which I can't if the session needs ending. So I can't change scaling until that vidco is over.
There is the "no-logout" option, but then things don't change (unless user manually starts a new session). Is that correct?
If so, the following suggests there might be a way to get things applied without logging out: https://askubuntu.com/questions/481329/can-i-restart-the-kde-plasma-desktop-without-logging-out Could that be combined with your tool - as it would be what I need, as I have to unplug/replug my external screen multiple times a day.
When using no-logout
it will simply not end yout X session. Plasma itself will be terminated using kquitapp5
, this however only affects the shell (desktop, panel, widgets etc) and not the other applications.
If you use the no-logout
option just wrap the call to dpiswitch in a script which then just calls kstart5 plasmashell
for plasma to start again without rebooting. Changes however, will not be fully applied.
If you run dpiswitch and then plug a new monitor, scaling may not affect that monitor as it is only guaranteed to scale any monitors currently connected when the command was ran.
You could also give Plasma Wayland a spin where dpi is handled much better by default and see if that works for you.
Thanks for responding so quickly! I'll give it a go. Tried a few simple things with xrandr + scaling but "ugly" of course. Tried following your setup instructions. Fail right at first shot:
$ dpiswitch --generate --profile default
[ERR] While reading from '<string>' [line 66]: section 'Colors:Header' already exists
System is Kubuntu 21.04. Not aware of any tweaks I've done except for setting up displaylink drivers (but at the moment not plugged in as I'm starting with the internal display only). What did I break :) ?
You should not use this on Wayland, it is meant only for X sessions. Wayland should switch between hidpi and lodpi automatically as well as support mixed dpi. It's still a work in progress of course so many things will not work.
Sorry, should have said that of course I'm running X11, not Wayland. Wayland gave me problems with displaylink on a previous installation when connecting screens, so I went for X11 for now.
Not sure if related, I'm not a programmer. Had a brief look at config.py which tries to get XDG_CONFIG_HOME
from the ENV variables - right? However, when I do env | grep XDG
, that's not there.
XDG_CONFIG_DIRS=/etc/xdg/xdg-plasma:/etc/xdg:/usr/share/kubuntu-default-settings/kf5-settings
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_TYPE=x11
XDG_CURRENT_DESKTOP=KDE
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_VTNR=1
XDG_SESSION_ID=3
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/plasma:/usr/local/share:/usr/share:/var/lib/snapd/desktop