You are not logged in.

#1 2024-12-11 08:38:14

Enla
Member
Registered: 2024-12-04
Posts: 16

Certain apps GTK and QT alike are stuck in light theme

Hello everyone,

I am trying to make all my apps be in dark theme. On QT apps I have issues across the board, with qt5ct complaining about the QT_QPA_PLATFORMTHEME not being set (despite being set in my environmnent.d/qt5.conf file, as recommended by this post . However, it still isn't taken into account even after a reboot.
As for GTK apps I have better luck, although nemo-fileroller does not respect it. It was set with lxappearance and I'm really confused about this one.

Cheers,

Offline

#2 2024-12-11 16:56:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,194

Re: Certain apps GTK and QT alike are stuck in light theme

environment.d files are not a shell and export is a shell construct, if you followed that ShitGPT generated garbage, it's wrong and you should instead follow the accepted response above it. ergo, get rid of the export and just keep QT_QPA_PLATFORMTHEME=qt5ct and also check for typos, you spelled environment.d wrong in your response here.

Last edited by V1del (2024-12-11 17:00:12)

Online

#3 2024-12-13 12:22:27

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

V1del wrote:

environment.d files are not a shell and export is a shell construct, if you followed that ShitGPT generated garbage, it's wrong and you should instead follow the accepted response above it. ergo, get rid of the export and just keep QT_QPA_PLATFORMTHEME=qt5ct and also check for typos, you spelled environment.d wrong in your response here.

Whoops, didn't realise it was ChatGPT...
I did also follow the above answer, and it didn't work sadly hmm I put it in my ~/.zshenv which should work in theory. I can echo the env var just fine but qt5ct still complains about it

Offline

#4 2024-12-13 16:18:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

I put it in my ~/.zshenv which should work in theory.

Not if it's not parsed to start the session (predominantly whether zsh is used to start the session)

QT_QPA_PLATFORMTHEME=qt5ct qt5ct

and post the actual output/complaint - in doubt link (please don't embed it) a screenshot

Online

#5 2024-12-16 08:42:19

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

I put it in my ~/.zshenv which should work in theory.

Not if it's not parsed to start the session (predominantly whether zsh is used to start the session)

QT_QPA_PLATFORMTHEME=qt5ct qt5ct

and post the actual output/complaint - in doubt link (please don't embed it) a screenshot

Thank you, that did it. I thought it was parsed automatically, but guess not. Sadly this didn't fix all my issues as I envisioned, as qt5ct is now using the proper theme, though apps are still in light mode by default.

Offline

#6 2024-12-16 13:30:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

qt5ct is now using the proper theme, though apps are still in light mode by default

What "apps", what "proper theme" and did you configure a dark palette?

Online

#7 2024-12-17 08:33:34

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

qt5ct is now using the proper theme, though apps are still in light mode by default

What "apps", what "proper theme" and did you configure a dark palette?

The "apps" are for instance Kate, but also the nemo-fileroller and various random software that don't really offer theming but follow the system theme, like 1Password. They are all set to light theme by default.
I have set a dark theme for GTK (adwaita dark) through nwg-looks, and a QT theme (GTK2 darker) through qt5ct.

Offline

#8 2024-12-17 09:17:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

Kate runs on Qt6, you'll need and  to configure qt6ct
As for GTK, try "GTK_THEME=Adwaita:dark nemo-fileroller" (this has turned into a complete, xdg-portal driven, mess and afaiu only the environment variable can reliably impact this outside gnome)

Online

#9 2024-12-17 13:31:36

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

Kate runs on Qt6, you'll need and  to configure qt6ct
As for GTK, try "GTK_THEME=Adwaita:dark nemo-fileroller" (this has turned into a complete, xdg-portal driven, mess and afaiu only the environment variable can reliably impact this outside gnome)

Is it possible to remediate to the xdg-portal mess ? I wouldn't be surprised if it causes issues. I'll try the environment vars, thanks a lot for the help smile

Offline

#10 2024-12-17 14:39:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

"Use gnome" - I cannot be bothered to investigate behind the latest gnome nonsense, but from what I understood this currently only works with the gnome-specific xdg-desktop-portal implementation and that only works on gnome.

But the environment variable should™ trump everything else and so if it works, that'd be what I'd got for - and as a matter of fact: do wink

Online

#11 2024-12-17 21:00:48

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

"Use gnome" - I cannot be bothered to investigate behind the latest gnome nonsense, but from what I understood this currently only works with the gnome-specific xdg-desktop-portal implementation and that only works on gnome.

But the environment variable should™ trump everything else and so if it works, that'd be what I'd got for - and as a matter of fact: do wink

Sadly the env var did not work sad when I tell apps to follow the system theme they still go light, and same for the file roller. It only works in dark mode when I start it from the shell, but not the dmenu. It's all very weird honestly, and something I would very much like to find a solution to ahah

Offline

#12 2024-12-17 21:07:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

Do you export the environement variable to dmenu or the script it invokes to run the input?

Online

#13 2024-12-17 21:19:35

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

Do you export the environement variable to dmenu or the script it invokes to run the input?

I don't know how to do that to be fair, I assumed it would follow the system-wide variables ? It's set through hyprland, should I put them someplace else ?

Offline

#14 2024-12-17 21:29:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

You're using dmenu w/ Hyprland?

tr '\0' '\n' < /proc/$(pidof Hyprland)/environ
tr '\0' '\n' < /proc/$(pidof dmenu)/environ

will print the environment seen by Hyprland resp. dmenu and dmenu is likely invoked by dmenu_run, https://wiki.archlinux.org/title/Dmenu

Online

#15 2024-12-17 21:35:28

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

You're using dmenu w/ Hyprland?

tr '\0' '\n' < /proc/$(pidof Hyprland)/environ
tr '\0' '\n' < /proc/$(pidof dmenu)/environ

will print the environment seen by Hyprland resp. dmenu and dmenu is likely invoked by dmenu_run, https://wiki.archlinux.org/title/Dmenu

It seems like the dmenu can see the same environment vars. I'm using rofi dmenu if that changes anything.

Offline

#16 2024-12-17 21:38:22

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

It would change that "pidof dmenu" is likely empty?
Leaving aside "then why not wofi"

grep -z GTK_THEME /proc/$(pidof rofi)/environ

Online

#17 2024-12-18 09:14:24

Enla
Member
Registered: 2024-12-04
Posts: 16

Re: Certain apps GTK and QT alike are stuck in light theme

seth wrote:

It would change that "pidof dmenu" is likely empty?
Leaving aside "then why not wofi"

grep -z GTK_THEME /proc/$(pidof rofi)/environ

Yeah, I used "pidof rofi" with rofi opened lol, forgot to say that.
For the command you gave here is the output :

 GTK_THEME=Adwaita:dark% 

And today for some godforsaken reason, after changing nothing, it works on more apps. The file roller is fixed, but the system theme is still detected as light for 1Password or Kate. I don't really mind for those apps in all honesty given that I can change the themes, but some others are more annoying. Like KDE Connect for instance, where it seems to follow the system theme.
Also I'm aware that rofi is suboptimal, but that's what I had setup when I was using a xorg WM. Is it worth it to switch to wofi ?

Offline

#18 2024-12-18 09:21:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,662

Re: Certain apps GTK and QT alike are stuck in light theme

As mentioned, kate is Qt6 and will adhere to either plasma specific settings or a proper qt6ct setup. Not! qt5ct.
And there's no "system theme" - you're dealing w/ a variety of toolkits which all use their own theming system.
KDE connect and kate will likely adhere to the same settings, though.

1password seems gtk3, but maybe also just electron and there's https://1password.community/discussion/ … preference

Online

Board footer

Powered by FluxBB