fix(theming): always sync prefer-light/dark with system theme toggle

Issue: #2357
This commit is contained in:
Lysec
2026-04-02 10:53:19 +02:00
parent 25a5eede06
commit ed117eb94c
2 changed files with 5 additions and 8 deletions
+3 -3
View File
@@ -178,9 +178,9 @@ async def main():
await sync_system_appearance(mode, update_gtk_theme=True)
print("GTK colors applied successfully")
else:
# CSS setup failed; still align gsettings (color-scheme + gtk-theme when themes exist)
# so apps do not end up with mismatched prefer-dark vs adw-gtk3 (inverted look).
await sync_system_appearance(mode, update_gtk_theme=True)
# Still push light/dark preference so portal/GTK apps follow the shell even when
# gtk.css / noctalia.css setup failed.
await sync_system_appearance(mode, update_gtk_theme=False)
sys.exit(1)
+2 -5
View File
@@ -18,15 +18,12 @@ Singleton {
property string colorsJsonFilePath: Settings.configDir + "colors.json"
readonly property string gtkRefreshScript: Quickshell.shellDir + "/Scripts/python/src/theming/gtk-refresh.py"
// GTK template: post_hook runs gtk-refresh after CSS; skip here to avoid a second, early run.
// No GTK template: sync updates org.gnome.desktop.interface when the user enables it.
// prefer-light/prefer-dark only; GTK template post_hook still runs full gtk-refresh.
function pushSystemColorScheme() {
if (!Settings.data.colorSchemes.syncGsettings)
return;
if (TemplateProcessor.isTemplateEnabled("gtk"))
return;
const mode = Settings.data.colorSchemes.darkMode ? "dark" : "light";
Quickshell.execDetached(["python3", gtkRefreshScript, mode]);
Quickshell.execDetached(["python3", gtkRefreshScript, "--appearance-only", mode]);
}
Connections {