Lumina and env variables

Ken Moore ken at ixsystems.com
Mon Jan 28 20:50:37 UTC 2019


On Saturday, January 26, 2019 1:37:34 PM EST, Grzegorz Junka wrote:
> On 21/01/2019 15:41, Ken Moore wrote:
>> On Saturday, January 19, 2019 9:33:41 AM EST, Grzegorz Junka wrote: ...
> Thank you Ken, that's a great tip. Does it mean that all Lumina 
> apps are qt5-based?
>
> I am a bit lost with all those customization applications. I 
> have QT 4 Configuration, which is using Desktop Settings, and I 
> have Customise Look and Feel, which seems to be changing GTK 
> settings. Then I have Desktop Configuration, which seems to be 
> running a yet different version of the Lumina Theme Engine, i.e. 
> Theme Engine run from the menu currently shows a window with a 
> dark theme and proper icons on buttons, but when running from 
> Desktop Configuration shows a light theme with no icons on 
> buttons, even though all settings seems to be the same. The same 
> lack of icons on buttons is visible in other QT-based 
> applications, i.e. Kate but not KWrite. Also the Desktop 
> Configuration seems to have a different set of icons then 
> selected in the Theme Engine (material design instead of 
> Oxygen).
>
> It's really weird. Imagine Lumina Theme Engine run from the 
> menu (LTH1) and from Desktop Configuration (LTH2). Changing 
> Style and Color scheme in LHT1 is visible in its preview window, 
> and when applied also changes LTH1 window (and KWrite). But LHT2 
> (and Kate) remain unaffected. Changing Style and Color scheme in 
> LHT2 is visible in its preview window, but when applied again 
> changes only LHT1 window (and KWrite) - LHT2 window (and Kate) 
> remain with the same (probably generic) theme and no icons on 
> buttons.
>
> I have been using Lumina from an early version and possibly 
> some configuration files have been screwed up throughout the 
> iterations. I also tried to overwrite QT_QPA_PLATFORM_THEME in 
> various places, including 
> .config/lumina-desktop/envsettings.conf, and deleting some 
> configuration files in .config and .kde/4 folders. Would you 
> know which configuration folders should I delete to restore 
> default settings? I understand I should not try to set 
> QT_QPA_PLATFORM_THEME/QP_QPA_PLATFORM_THEME anywhere?
>
> GrzegorzJ
>

Welcome to the chaotic world of application theming... ;-)

Let me give you the big picture first, and then focus on the Lumina side of 
things:

1. Every single toolkit has their own theme implementation.
This means that GTK2, GTK3, Qt4, Qt5, EFL, and any other graphical toolkits 
all expect their own theme specification/settings. There have been attempts 
to unify them a bit (GTK2 <--> Qt4, GTK3 <--> Qt5), but overall those 
unification systems tend to fizzle out and die pretty quickly because the 
standards for each change so rapidly (I blame GTK for that, but that is a 
topic for another time completely). I think the QtCurve theme engine is 
probably the closes one to achieving multi-toolkit support, but it also has 
a frustrating lack of customizability - so if you don't like the QtCurve 
theme, then you are stuck doing it yourself. This also means that every 
theme engine for every toolkit could have it's own utility for customizing 
the theme (if supported), which is probably where you are getting so many 
"theme configuration" utilities from that each look very different.

2. The "standard" for icon themes is a non-standard.
The [XDG 
standards](https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html) 
for icon themes are pretty well followed by all the toolkits with regards 
to detecting/using a particular icon theme, but the standard only lists 
~20-30 icons in the standard and is nowhere close to being usable by 
itself. A "full" icon theme has closer to 500+ icons at the present time, 
but each one uses it's own naming specification (because the XDG spec is 
non-specific), resulting in widely varying support for an application to be 
able to switch between icon themes without "losing" icon support for 
particular things. There is some continuity between icons themes if they 
come from the same source (all the GNOME themes tend to use the same naming 
scheme, the KDE/Plasma icon themes use the same naming scheme, etc), but 
those different naming schemes are not compatible with each other in 
general. This results in people trying to develop "full" icon themes having 
to track down and implement tons of symlinks for icons just to try and 
catch all the variations of an icon name that are used across different 
applications and desktops (this is a huge task and most icon theme 
developers just give up after a short time). 
For an example, the icon theme we are using for Project Trident technically 
has 6865 different icons (all of them SVGs - prevent duplication of the 
same icon across different size ranges like the specs use). Of those icons, 
I would estimate that we have close to a 10:1 ratio of symlinks to real 
files just in order to account for variations in icon naming across the 
various apps/desktops, and we are *still* having issues with some apps not 
being able to find icons occasionally.

3. Xorg mouse cursor themes
Don't ask. This is yet another "standard" that most toolkits load by 
default but completely ignore at the first chance they get because the 
"standard" is insufficient for tons of things.


Now for the lumina side of things.
1. Lumina is completely Qt5-based, so the Lumina theme engine is *only* 
used for theming Qt5-base applications. This means that KDE4 applications 
will not use it (Qt4), Firefox/Chromium will not use it (GTK2/3), but the 
Falkon browser *will* use it (Qt5), and many of the KDE/Plasma5 
applications will also use it (Qt5).

2. Instead of going for the one-size-fits-all approach to themes that most 
engines use, the Lumina theme engine is a fork/update of qt5ct which is 
designed around the concept of a single theme engine being itself 
configurable. For example, I mentioned the QtCurve engine previously and it 
follows the "engine=look" model where if you don't like it you have to find 
another engine. qt5ct and lthemeengine take the approach that we stick to a 
single toolkit, but expose all of the configuration options via the engine 
itself - so a single engine can have an infinite number of appearance 
outputs. The only thing the engine needs to stay in-sync with is the 
toolkit it is allowing access to modify.

Example:
As part of lthemeengine, you have full access to set your own color palette 
and have it apply to all Qt5 applications the exact same way without any 
difficult "styling" challenges. By and large, this is the main thing that 
people want when looking to change the appearance of apps anyway, so they 
can change some "highlight" color from red to blue or any color of the 
spectrum that they want. Lthemeengine also provides access to selecting the 
icon theme and mouse cursor theme (which *will* apply to all toolkits if 
they follow the XDG/Xorg specifications - which not all do). In addition to 
this lthemeengine gives access to a special type of thing called "Qt 
Stylesheets" which is basically a way of using a CSS-like language[1] to 
dynamically change the appearance of Qt5 widgets and items (which the 
Lumina desktop uses for styling the panels, desktop plugins, and more). I 
think GTK3 has a similar CSS-like system but uses a completely different 
rules-set for it compared to Qt5.

[1] http://doc.qt.io/qt-5/stylesheet-reference.html


I am sorry for this "book" of information, but I hope this helps to clarify 
a bit of the whole theme mess for you and why everywhere you look you will 
find different answers to the same themeing problems (and I did not even 
get started on how the different desktop environments overwrite the engine 
settings and provide their own ways of changing the appearance....)

-- 
~~ Ken Moore ~~
TrueOS/iXsystems


More information about the freebsd-x11 mailing list