You are not logged in.

#1 2022-11-28 19:32:27

Henry78
Member
From: Vienna
Registered: 2012-01-23
Posts: 65

GTK4 applications not switching to dark theme

Hi everybody!

I borked up(?) my GTK settings(?) somehow and don't get a dark theme for GTK4 applications (i.e. nautilus, gnome-clocks), except prepending GTK_THEME=Adwaita:dark to the commandline. I tested out different themes in the past and wanted to go back to (default) Adwaita.

So GTK4 applications have the light theme, regardless if the "Dark Mode" switch in Gnome is set or not; interestingly GKT3 apps (i.e. evolution) honor the "Dark Mode" switch. But if I explicitly set GTK_THEME=Adawaita, the applications properly use the dark theme.

I checked everything I know of, from my gsettings:

/org/gnome/desktop/interface/gtk-theme = 'Adwaita' (which is default)
/org/gnome/desktop/interface/gtk-key-theme = Default (which is default)
/org/gnome/desktop/interface/color-scheme = Default or 'prefer-dark' (switches - as expected - with the "Dark Mode" switch)

So my question is: which settings did I break or miss to check? Any means to debug this?

Last edited by Henry78 (2022-11-28 19:40:26)

Offline

#2 2022-11-29 15:23:10

eda2z
Member
From: Woodstock, IL
Registered: 2015-04-21
Posts: 66

Re: GTK4 applications not switching to dark theme

Selecting the Dark Style in Settings / Appearance should give all GTK4 apps a dark "style". My understanding is that themes only work on GTK3 apps and that gnome now uses libadwaita for its "themes". If you look in Appearance under Tweaks you will see that themes only apply to "Legacy Applications".

Offline

#3 2022-11-30 19:04:19

Henry78
Member
From: Vienna
Registered: 2012-01-23
Posts: 65

Re: GTK4 applications not switching to dark theme

@eda2z, thanks for your answer!

When I talk about the "Dark Mode" switch in Gnome, I mean the quick toggle, which essentially changes

/org/gnome/desktop/interface/color-scheme

. I'm aware that Tweaks > Appearance > Themes is for Legacy (GTK3) applications.

Also this makes me wonder where and how I broke the GTK4 apps, imho they should switch light/dark just so. I put Arch on a local VM and found that after a fresh installation the light/dark switching just works, I really don't know how to debug ...

Offline

#4 2022-12-01 19:02:58

eda2z
Member
From: Woodstock, IL
Registered: 2015-04-21
Posts: 66

Re: GTK4 applications not switching to dark theme

On my system if I select Dark Style in Settings/appearance it changes

/org/gnome/desktop/interface/color-scheme

to 'prefer dark'. I'm not aware of any other quick toggle.

Offline

#5 2022-12-03 13:28:07

Shyne
Member
Registered: 2012-04-09
Posts: 7

Re: GTK4 applications not switching to dark theme

I had same issue.
It was a css file in ~/.config/gtk-4.0/gtk.css that preventing quick toggle to work.

Removing gtk.css file fixed the issue.

Offline

Board footer

Powered by FluxBB