How make QT_STYLE_OVERRIDE permanent for Libre Office?

I set up a well working combo of Kvantum and Aurorae theming. There is however one case where it’s bugged: Libre Office.

At the first glance, there are no apparent differences but in some pop-up and dialog windows, some UI elements are not shown correctly, to the point that some elements are even broken (like color filter).

To run the app with the QT override, I can use:

QT_STYLE_OVERRIDE=Breeze libreoffice --calc

Unfortunately, it only works when launched from terminal. If I modify launchers from start menu, it doesn’t work, because LO doesn’t hold launchers (.desktop files) in user space. I even decided to modify the original launchers on the root folder (aware that they will be overwritten on each LO update), but it never works.

To give you details: I modified launches in:

/usr/lib/libreoffice/share/xdg/

so they would have in exec line:

Exec=QT_STYLE_OVERRIDE=Breeze libreoffice %U

and so on. When I click on those files and launch them, it launches correctly with the breeze override. When I search in the start menu and check the launcher command it also shows correctly with breeze override but… when launched from start menu, the theming is not overwritten. The same when I pin the shortcut to the panel/desktop - it also launches without override.

Any idea how to set it up permanently and on which file? Semi-permanent (until next LO update) will also do.

How about using the Kvantum Manager to permanently assign a different theme to LibreOffice?

How do I do that? I wasn’t aware there is such possibility.

EDIT: I found it. But I can set there only other Kvantum theme, but I wanted to have default Breeze theming (not Kvantum) on LO, which isn’t possible from Kvantum.
Also, in settings there is no clear explanation what should I give, just app name, launcher name, full path?
I suspect that because LO launches atypically, it won’t abide Kvantum override anyway.

1 Like

Anyway, I still have no solution, but there has to be some.
LO is using DE configs to take theming, so maybe in those configs there are some solutions?

1 Like

Thank you @FadeMind ! This is the solution!

For the sake of others, I simplify it here:

Instead of libreoffice, I had to use /usr/lib64/libreoffice/program/soffice.bin

So what I did, I edited those lines (line numbers in brackets):

/usr/lib/libreoffice/share/xdg/calc.dekstop

[18] Exec=QT_STYLE_OVERRIDE=Breeze /usr/lib64/libreoffice/program/soffice.bin --calc %U
[43] Exec=QT_STYLE_OVERRIDE=Breeze /usr/lib64/libreoffice/program/soffice.bin --calc %U

/usr/lib/libreoffice/share/xdg/starter.desktop

[25] Exec=QT_STYLE_OVERRIDE=Breeze /usr/lib64/libreoffice/program/soffice.bin %U
[46] Exec=QT_STYLE_OVERRIDE=Breeze /usr/lib64/libreoffice/program/soffice.bin --calc %U

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.