Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: xqtha2276 on 22 August 2020, 21:14:12

Title: [SOLVED] KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 21:14:12
I recently migrated the user folder from my old Ubuntu installation to my Artix install. In doing so, there has been some breakage due to folders of the Ubuntu install being given root permissions where they would normally be user permissions.

One of my issues is color themes for KDE Plasma are not applying correctly. While certain parts of QT change accordingly, others like the view area remain stock "Breeze" no matter what theme I choose- even "Breeze Dark". It really looks like something that would be solved by a reboot. But, alas, it never is.
I also ensured "/home/$USER$/.kde/share/apps/color-schemes" has user permissions. Still, nothing.

Any ideas of where I should look to next? Is this not a permissions issue and something that can be solved some other way?
Title: Re: KDE Color themes not applying correctly
Post by: SGOrava on 22 August 2020, 21:20:26
In KDE you probably need to check in system settings places like:
- Global theme
- Plasma style
- Application style
- Colors

The "colors" themes apply only for some parts which are written in QML, for other programs you probably need to check application style or something else. KDE is a monster in this case.
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 21:40:55
Oh, I forgot to mention I've messed with the system settings a good deal. No combination of global theme, plasma style, application style, etc. makes colors apply correctly. So, my guess is some folder related to themes somewhere is locked to root and locking the themes out of being applied everywhere. I already had to change the permissions of some folder (can't remember what, sadly) in order to even access color settings in the first place.
Title: Re: KDE Color themes not applying correctly
Post by: SGOrava on 22 August 2020, 21:45:14
in such case check your env vars if you have something qt related there

Code: [Select]
env | grep -i qt
Title: Re: KDE Color themes not applying correctly
Post by: alium on 22 August 2020, 21:57:37
did you use qt5ct ? or similar program for set gtk/qt theme?
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 22:04:32
Here's the output of
Code: [Select]
env | grep -i qt
Code: [Select]
QT_SCREEN_SCALE_FACTORS=eDP-1=1;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
QT_QPA_PLATFORMTHEME=gtk
QT_STYLE_OVERRIDE=gtk2
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
QT_AUTO_SCREEN_SCALE_FACTOR=0

Not sure if there's anything useful to glean from it.

>did you use qt5ct ? or similar program for set gtk/qt theme?
I used the "Colors" section of system settings.
Title: Re: KDE Color themes not applying correctly
Post by: alium on 22 August 2020, 22:11:41
QT_STYLE_OVERRIDE=gtk2 can make this trouble, can you remove it, and eventually install and use qt5ct ? (you say Qt: hey qt, use my very ugly gtk2 theme instead...)


Unlike Qt4, Qt5 does not ship a qtconfig utility to configure fonts, icons or styles. Instead, it will try to use the settings from the running desktop environment. In KDE Plasma or GNOME this works well, but in other less popular desktop environments or window managers it can lead to missing icons in Qt5 applications. One way to solve this is to fake the running desktop environment by setting XDG_CURRENT_DESKTOP=KDE or GNOME, and then using the corresponding configuration application to set the desired icon set.

Another solution is provided by the qt5ct package, which provides a Qt5 QPA independent of the desktop environment and a configuration utility. After installing the package, run qt5ct to set an icon theme, and set the environment variable QT_QPA_PLATFORMTHEME=qt5ct so that the settings are picked up by Qt applications. Alternatively, use --platformtheme qt5ct as argument to the Qt5 application. (from arch's wiki)
Title: Re: KDE Color themes not applying correctly
Post by: SGOrava on 22 August 2020, 22:31:53
As alium mentioned, these 2 env vars  can cause problems:
Code: [Select]
QT_QPA_PLATFORMTHEME=gtk
QT_STYLE_OVERRIDE=gtk2
And  if you are using some other DE/MW other than KDE/Plasma you should use qt5ct (https://wiki.archlinux.org/index.php/Qt#Configuration_of_Qt5_apps_under_environments_other_than_KDE_Plasma)

I use qt5ct together with Kvantum and Qt5 looks nice (apart from QML things which i just do not like)
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 22:36:27
Wow, this issue is getting surprisingly tedious.
So, I installed the qt5ct package. I then entered "unset QT_STYLE_OVERRIDE" followed by "export QT_QPA_PLATFORMTHEME=qt5ct" in the terminal.
Despite my output of "env | grep -i qt" having been this:

Code: [Select]
QT_SCREEN_SCALE_FACTORS=eDP-1=1;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
QT_QPA_PLATFORMTHEME=qt5ct
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
QT_AUTO_SCREEN_SCALE_FACTOR=0

The Qt5 settings tool still gave me this error:

"Please remove the QT_STYLE_OVERRIDE environment variable (current value: gtk2).

The QT_QPA_PLATFORMTHEME environment variable is not set correctly (current value: gtk, required value: qt5ct)."

I tried rebooting. But then, the environment variables were reset, and changing them accordingly did nothing for qt5ct again.
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 22:38:56
Even still, the qt5ct solution is a workaround/compromise. If I want to use proper QT colors, I'm gonna need to solve the root of the problem and not just hack in GTK themes.
Title: Re: KDE Color themes not applying correctly
Post by: alium on 22 August 2020, 22:52:04
with qt5ct should be now works kde settings without problems, so you can set color under kde, or?
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 23:17:04
No. Like I said, qt5ct is ignoring the variables I set for some reason- unless I set them wrong somehow
Title: Re: KDE Color themes not applying correctly
Post by: SGOrava on 22 August 2020, 23:30:08
how did you set the variables ?
where did you set them?
if in some global file did you at minimum relogin or rebooted ?
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 22 August 2020, 23:41:30
Quote
I then entered "unset QT_STYLE_OVERRIDE" followed by "export QT_QPA_PLATFORMTHEME=qt5ct" in the terminal.
Despite my output of "env | grep -i qt" having been this:

Code: [Select]
QT_SCREEN_SCALE_FACTORS=eDP-1=1;DP-1=1;HDMI-1=1;DP-2=1;HDMI-2=1;
QT_QPA_PLATFORMTHEME=qt5ct
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
QT_AUTO_SCREEN_SCALE_FACTOR=0

The Qt5 settings tool still gave me this error:

"Please remove the QT_STYLE_OVERRIDE environment variable (current value: gtk2).

The QT_QPA_PLATFORMTHEME environment variable is not set correctly (current value: gtk, required value: qt5ct)."

I tried rebooting. But then, the environment variables were reset, and changing them accordingly did nothing for qt5ct again.
Title: Re: KDE Color themes not applying correctly
Post by: SGOrava on 23 August 2020, 01:06:34
how did you change them?

the env vars can be set in many many places.
most used places to set these vars are:
- /etc/environment
- ~/.xinitrc
- ~/.bashrc # or your shell config
- ~/.profile
- ~/.bash_profile

If there is nothing, it can also be somewhere in your DM or some other init scripts.
(I am thinking also about these edge cases since you said you played a bit.)

Changing the variables in one terminal will not change them in your system.
When you change the variables in one terminal the variables will only ba changed in it and in programs you execute from it..
For example, if you change env vars in terminal and then try to start some qt program from ANOTHER terminal (can be your DE/WM, menu, etc) it will use environment variables which were set at the moment it started (at least that is my observation.)

So check where you are setting the variables and change them there, you need to make it permanent.
For some tests you can change it in terminal and start programs from there (but this is truly for testing and hacking only).

Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 24 August 2020, 03:28:50
Okay, good to know- thanks. So, is qt5ct something akin to something like qtcurve in respect to wholly replacing the stock QT theming system? I used qtcurve before and am aware of its extensibility benefits. It seems like qt5ct is much less feature packed, but I haven't looked into it too much. Anyway, are there drawbacks to using GTK colors hacked to work with QT over normal QT colors?
Title: Re: KDE Color themes not applying correctly
Post by: nous on 24 August 2020, 19:14:15
I recently migrated the user folder from my old Ubuntu installation to my Artix install.
The definitive theming resource is the Arch wiki (https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications). However, you must also read how the uniform dark theme is applied in Artix (https://wiki.artixlinux.org/Main/Troubleshooting#When_I_switch_theme_in_Plasma.2FMATE.2FXFCE.2FAnyDEorWM_the_colours_are_broken.21).

One of my issues is color themes for KDE Plasma are not applying correctly. While certain parts of QT change accordingly, others like the view area remain stock "Breeze" no matter what theme I choose- even "Breeze Dark". It really looks like something that would be solved by a reboot. But, alas, it never is.
I also ensured "/home/$USER$/.kde/share/apps/color-schemes" has user permissions. Still, nothing.
Any ideas of where I should look to next? Is this not a permissions issue and something that can be solved some other way?
The fact that you migrated your user directory from another distro is the main problem here. I can safely guess that copied-over settings interfere with the correct theme application. My suggestion is that you backup everything out of ~/.config, copy /etc/skel/* into your home dir and logout-login. I'm not sure whether KDE overwrites settings on logout, you might want to be logged out and perform this task from the console. Then, merge into your clean ~/.config the backed-up settings of the applications you use.

The way theming works in Artix is tersely explained here: https://forum.artixlinux.org/index.php/topic,1380.msg11309/topicseen.html#msg11309
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 25 August 2020, 03:02:58
Thank you, that's very helpful.
Title: Re: KDE Color themes not applying correctly
Post by: xqtha2276 on 25 August 2020, 04:08:25
Wow, your solution worked like a charm. Now, all I have to do is copy folders from my clean backup over one to a few at a time (depending on what application the config is for). If themes break again, I'm able to know precisely what caused it. Also, I didn't need to log out and work from the console- just used Dolphin.
I really wasn't expecting to make much progress solving this stuff. Needless to say, I'm a very happy camper :D
Title: Re: KDE Color themes not applying correctly
Post by: nous on 03 September 2020, 19:59:23
See? Artix theme-ing isn't neither broken nor hardcoded. Thanks for your report.