-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kde: Apply theme without GUI session, ignore failures (#809) #848
base: master
Are you sure you want to change the base?
kde: Apply theme without GUI session, ignore failures (#809) #848
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My testing reveals that the two
So, before this PR, you could run the activation in a running Plasma session and everything would work. Or, since #823, you could run the activation in a non-Plasma GUI session and the theme would work but the wallpaper not. |
When you run a QT app, it uses a platform plugin as an implementation for functionality like filesystems or windowing. If you look at plasma-apply-lookandfeel output, it finds a plugin, but fails to initialize it due to the environment the plugin expects to find itself (no windows in tty, for instance). Ideally, we would force the tools to use the |
Well I just found a forum post: https://forum.qt.io/topic/151317/qt-platform-plugin-xcb-could-not-load-qt6. @lordkekz could you try to run |
I did but it didn't work on my system. |
OK, thank you, but it's weird. I tried it on my system, outside Plasma, and it did work. Do you have the logs? |
I must correct myself; it produces errors but does seem to update the theme. So it seems that it would be possible to just do Here's the log:
Do you get any output? |
It should be. I would either add it to the original (pre PR) script, perhaps making use of
I got the same, apart from the disk full one. The program exited successfully, so I think it should be okay. I would try to use |
I think this is the most correct thing we could do, @lordkekz will you go ahead? |
Fixes #809
Problem
Activation didn't work for users on Hyprland who still use stylix's KDE target for theming Qt apps.
The
plasma-apply-*
commands require some parts of the plasma session to be available:plasma-apply-lookandfeel
requires an available Qt Platform Abstraction, which is not a guaranteed with some autostart or automatic activation setups. This can be satisfied with non-Plasma GUI sessions such as Hyprland or Xvfb.plasma-apply-wallpaperimage
doesn't require a Qt Platform, but does require Plasma itself to be running, so this will still not work without the autostart script from Fix plasma activation #708.Solution / Change Summary
$DISPLAY
variable is set.xvfb-run
waits 3 seconds for the headless Xorg server to start. This delay only happens once because bothplasma-apply-*
commands run in a single script passed toxvfb-run
.plasma-apply-*
commands fail.I am strongly in favor of ignoring at least
plasma-apply-wallpaperimage
because it is expected to fail even when there is no misconfiguration:plasma-apply-wallpaperimage
fails on some activation setups and on non-Plasma setups which still usestylix.wallpaper
(e.g. Hyprland).Potential alternatives
I initially tried to give Qt a platform to work with independently from the main Plasma/Hyprland session being fully started or not. There's some documentation for different Qt Platform Abstractions here but I couldn't get
offscreen
,vnc
orminimal
to work in my TTY.plasma-apply-lookandfeel --apply stylix
produces on my TTY:Exit code
-6
Backporting
My initial attempt is based on NixOS 24.11, see 1427b55. I can open another PR for 24.11 if you're okay with that.