From a0221b42dc7a344ec2922ae328e655a2fead6a18 Mon Sep 17 00:00:00 2001 From: The_miro Date: Fri, 10 Jul 2026 16:23:49 +0200 Subject: [PATCH] fix(flatpak): apply QT_QPA_PLATFORMTHEME override alongside GTK_THEME Flatpak apps don't inherit the host's QT_QPA_PLATFORMTHEME=gtk3, so Qt apps (Wireshark, PrismLauncher, ...) ignored the cyberqueer theme even though GTK_THEME was already being overridden per-app. Co-Authored-By: Claude Sonnet 5 --- setup/modules/lib/logging.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/setup/modules/lib/logging.sh b/setup/modules/lib/logging.sh index 8611a5a..91029d9 100644 --- a/setup/modules/lib/logging.sh +++ b/setup/modules/lib/logging.sh @@ -121,8 +121,13 @@ ensure_flatpak() { # ── apply_flatpak_theme ──────────────────────────────────────────────────────── # WHY: Flatpak apps run in sandboxes and can't access the host ~/.themes directory # by default. We must explicitly grant filesystem access AND set GTK_THEME. +# Qt apps (Wireshark, PrismLauncher, ...) don't follow GTK_THEME on their +# own — the host sets QT_QPA_PLATFORMTHEME=gtk3 (see envvars.lua/envvars.conf) +# so Qt borrows the GTK theme via the gtk3 platform plugin, but Flatpak apps +# don't inherit host env vars, so the same var must be overridden per-app. # WHAT: Copies the cyberqueer GTK theme into ~/.themes, grants the Flatpak app -# read-only access to that directory, and overrides the GTK_THEME env var. +# read-only access to that directory, and overrides GTK_THEME and +# QT_QPA_PLATFORMTHEME so both GTK and Qt apps pick up the theme. # # Usage: apply_flatpak_theme # e.g. apply_flatpak_theme org.gnome.gedit @@ -151,5 +156,9 @@ apply_flatpak_theme() { # Set GTK_THEME env var for this app so GTK picks up the correct theme name flatpak override --user --env=GTK_THEME="$theme_name" "$app_id" - log "Cyberqueer theme applied to $app_id." + # Set QT_QPA_PLATFORMTHEME so Qt apps route through the gtk3 platform + # plugin and pick up the same GTK_THEME, matching the host setup. + flatpak override --user --env=QT_QPA_PLATFORMTHEME=gtk3 "$app_id" + + log "Cyberqueer theme applied to $app_id (GTK + Qt)." }