I’m not using YaST that often, so I don’t know since when it has stopped using the system theme and colors on TW with XFCE. It appears in a white background using bigger fonts.
Some KDE apps I’m using as root, have the same issue but starting them using sudo -E appName corrects the problem. Not with YaST though. It keeps appearing differently.
… but you beat me to it It’s what I’ve used for years and always suggest it. I assume, but need to ask to be sure, are you using “yast2” for the appName, as in:
~:> sudo -E yast2
??
I might be inclined to log in as a “new” user and see if the issues occurs with that account.
I read recently somewhere that KDE allegedly stopped applying its theme to non-KDE applications, as it had done for so many years. I could understand this for Gtk programs, but obviously Qt programs are affected, too - like YaST, Myrlyn, QDirStat, VLC (?).
I am curious: Does anybody here have a pointer to some reference documentation? I am not sure how reliable my source was, or if it was just hearsay.
Hi @shundhammer … I can’t confirm what you’ve read recently.
The only feedback I have is what I’m running now.
I just installed Leap 16.1 a couple of days ago, so obviously very current (maybe not like TW). If I execute “sudo -E myrlyn”, it inherits my theme. If I execute, “su -l” then execute “myrlyn”, it uses the theme for the root user.
So, for the most current Leap 16.1, it still works.
Then I’ll need to find out what environment variables I am missing in myrlyn-sudo that makes Qt use the user’s widget theme and fonts in the sudo call.
OK, I made some more tests and I got some new results. From your post I realized I hadn’t run YaST itself using sudo -E.
Running YaST and YaST Software from the Whisker Menu produces the problem.
Running sudo -E /usr/lib/YaST2/bin/sw_single_wrapper to start YaST Software produces the problem.
Running sudo -E yast2 though makes YaST use the system theme correctly and running Yast Software from within YaST afterwards makes it use the correct theme too.
So, it seems the issue exists in cases 1 and 2 only.
Sure; otherwise you couldn’t tell sudo to preserve the entire environment.
Early last year I had to do a lot of research about sudo, su, pkexec and how to let a Myrlyn user keep the personal environment for things such as the Qt resize factor for reasonable font sizes, and basics such as accessing the X11 or Wayland session across the root vs. the user’s session.
I identified a number of environment variables (see the myrlyn-sudo script), but obviously one or several are missing that KDE uses. But which ones are that?
@alexsec YaST is a complex beast; it’s wrapper scripts that call a Ruby interpreter with some YaST glue code that calls more Ruby code as well as some C++ libraries (libyui, libyui-qt, libzypp etc.). Environment variables may get lost or added at several steps of the way.
Just look at the ps aux or pstree output while YaST is running to get an idea.
But think twice about how much time you want to spend on this: The days of YaST are numbered. There is very little maintenance for it, and when it stops working, it might officially go the way of the Dodo. It might be something as harmless as a Ruby update, or some Ruby gem becoming incompatible.
Just wanted to add that this is not a KDE-specific problem, I have the exact same thing happening on GNOME in TW. @myswtest thanks for providing the solution, I can finally use YaST in dark mode
This is a great way to solve this since it creates the necessary configuration file in the root folder. Maybe copying that file from the user folder to the root folder would have the same result.
What I’m wondering though is why this issue appeared all of a sudden. Yast used to be OK for more than a year. There was no need for workarounds for it to use the user theme. On another TW system I’m using, it still works fine without any need for workarounds. Something has caused this change in its behavior on one system. What might that be?
Well, as shundhammer said, yast is fading away from the scene. It’s long time role will be cut
and we just hopefully wait for another great beast to replace it.