You are not logged in.

#1 2020-10-10 02:13:53

Oakbricks101
Member
Registered: 2019-08-24
Posts: 3

[Solved] Getting qt5ct and QT5 themes to work

Hello, I want to change the QT5 themes for apps, but every time I launch qt5ct it says that it's not properly configured and in a dialog window it says "The QT_QPA_PLATFORMTHEME environment variable is not set (required value: qt5ct )", Its kina weird seeing a dark GTK theme with a light QT theme

My dot files for environment variables:

/etc/environment

 --------------------------------------
#QT_QPA_PLATFORMTHEME=lxqt
QT_QPA_PLATFORMTHEME=qt5ct 

~/.config/openbox/environment

 QT_QPA_PLATFORMTHEME=qt5ct 

Last edited by Oakbricks101 (2020-10-11 04:02:59)

Offline

#2 2020-10-11 04:02:37

Oakbricks101
Member
Registered: 2019-08-24
Posts: 3

Re: [Solved] Getting qt5ct and QT5 themes to work

SOLVED:

For anyone with this issue you need to make or edit ~/.profile and type in

 export QT_QPA_PLATFORMTHEME="qt5ct"  

Source: https://wiki.manjaro.org/index.php/Set_ … e_settings

Offline

#3 2021-04-10 14:36:09

lubosz
Member
Registered: 2012-10-01
Posts: 4

Re: [Solved] Getting qt5ct and QT5 themes to work

To make this work in GNOME 4 Wayland i needed to put

export QT_QPA_PLATFORMTHEME=qt5ct

in

/etc/environment

Last edited by lubosz (2021-04-10 14:38:17)

Offline

#4 2024-02-06 05:31:41

Francewhoa
Member
From: Sept-Îles, Québec, Canada
Registered: 2023-01-21
Posts: 3
Website

Re: [Solved] Getting qt5ct and QT5 themes to work

lubosz's answer about GNOME 4 Wayland is correct. It works. Thanks for your answer smile

For those interested in a more stable Linux Arch, I suggest adding this configuration:

export QT_QPA_PLATFORMTHEME="qt5ct"

into an override configuration file. For example, into this "qt5.conf" override file at:

/etc/environment.d/qt5.conf

--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---

Below is the same as above. But with details and sources for those interested.

The "environment" file is a core Linux file. Editing any core Linux files is risky to result in an unstable Linux. Simply because, in the future, during Linux periodic updates, any Linux core files may be deleted and replaced. In turn, you risk loosing your valuable configurations. In turn, you risk an increasingly unstable Linux. In turn, you risk spending hours or days searching for the cause of an unstable Linux. To find out that somehow, your configuration was automatically removed.

To resolve this challenge above, I suggest editing a Linux override file. Instead of editing a Linux core file. The main difference between a core file and override file is that, in the future, after the periodic Linux updates, all your override files will likely automatically remain. Thus, a more stable Linux smile Those files are called override because any configuration you add to them will automatically override any core Linux configuration.

According to the Linux community, when possible and when appropriate, it is suggested to always add your configuration to override files

 

Steps to add the qt5 theme configuration to an override file:

1. If not already done, create a "environment.d" folder at "/etc/environment.d/qt5.conf". By the way, in the folder name, the ".d" suffix means an override. So double-check that you use the "environment.d" override folder. Not the core "environment" folder.

2. Inside that "environment.d" folder. Add a "qt5.conf" override file. This "qt5.conf" file could be any other override file name to your liking.

3. Inside that "qt5.conf" file, add this line:

export QT_QPA_PLATFORMTHEME="qt5ct"

4. Set appropriately the permissions on both the override folder and override file above. If not sure, for your override folder and file, use the exact same permissions as the core folder and file.

5. For the new configuration to be applied, you might need to reboot your device. Done. Enjoy your more stable Linux smile

     

Related documentation about Linux configuration overrides at:

 

https://jmmv.dev/2020/08/config-files-v … ories.html

___• https://archive.ph/rcXKV

___• https://web.archive.org/web/20230131035 … ories.html

 

https://manpages.debian.org/apt/sources.list.5.en.html

___• https://archive.ph/cauJe

___• https://web.archive.org/web/20240206050 … .5.en.html

 

https://www.redhat.com/sysadmin/etc-con … irectories

___• https://archive.ph/wip/qDg5j

___• https://web.archive.org/web/20240202050 … irectories

Last edited by Francewhoa (2024-02-06 05:43:01)

Offline

Board footer

Powered by FluxBB