SUMMARY gtk-application-prefer-dark-theme is meant for the app itself to force dark mode, not for the desktop environment to tell whether the app should use dark mode, thus there's no way to force GTK to re-read its value. The only proper way to switch GTK between light and dark theme is to let the user to set a light GTK theme and a dark GTK theme in the interface and then switch between them as needed. A more stupid way is to add -dark to theme name when switching to dark color scheme like this GNOME extension (https://github.com/mukul29/legacy-theme-auto-switcher-gnome-extension/blob/09bb3cf10f8787c17f459af53fbc41d252876532/extension.js#L30-L40) is doing but there's no guarantee that the theme follows this naming scheme (although is likely to be right in most cases). STEPS TO REPRODUCE 1. Switch Plasma to dark color scheme 2. Start a GTK3 app 3. Switch Plasma to light color scheme OBSERVED RESULT The app is still dark EXPECTED RESULT The app switches to light colors SOFTWARE/OS VERSIONS Operating System: NixOS 25.11 KDE Plasma Version: 6.4.5 KDE Frameworks Version: 6.18.0 Qt Version: 6.9.2 Kernel Version: 6.17.0-cachyos (64-bit) Graphics Platform: Wayland Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor Memory: 64 ГиБ of RAM (62.7 ГиБ usable) Graphics Processor: AMD Radeon RX 6400 Manufacturer: Micro-Star International Co., Ltd. Product Name: MS-7C94 System Version: 1.0
If we did what you suggest, then GTK apps wouldn't automatically switch to dark mode when you change the KDE color scheme. That would be unexpected, I think. How do you think we should handle that, if we implemented the suggestion?
I have enumerated two more proper alternatives right in the summary, did you read it?
Not very well, apparently. :/ But let's back up a bit. Can you clarify what exactly you mean by "Switch Plasma to dark color scheme"? Strictly speaking, you can't do this. You can switch the color scheme (which might affect Plasma, if it's a color-scheme-aware Plasma theme) or you can switch the Plasma theme (which doesn't affect the colors of any apps, KDE and GTK alike), or you can switch the global theme (which will affect all of them). Which one do you mean?
Switch colors or global theme in system settings, either should work. I was checking via colors.
And which apps are you testing with?
Any gtk3 application should suffice. You can check e.g. those provided by gtk itself (gtk3-demo, gtk3-widget-factory, etc). And, well, if I run non-KDE Qt apps (like qBittorrent) with QT_QPA_PLATFORMTHEME=gtk3 set, they get affected by this, too... Looks like Qt does a good job of getting colors from GTK3 even repeating the bugged behavior.
Looks like GTK learned to follow system light/dark mode only 3 months ago (GTK 4.20+). Previously only libadiwata apps were supporting this. It reads org.freedesktop.appearance.color-scheme from portal and maps it to gtk-interface-color-scheme property in GtkSettings: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8803 All previous GTK versions, including GTK 3, just have no support for this, with the best possible workaround of switching between GTK themes.