"Theme: Follow system" broken with GNOME 42 and flatpak

It seems that Anki ignores the org.freedesktop.appearance.color-scheme key from the settings portal. When the system-wide dark style preference is toggled to dark (for example automatically at sunset), Anki stays on the light theme.

Unless I’m mistaken, there is a KDE implementation, so it would work for KDE too: in the KDE gitlab, enter in “plasma” group, then “KDE Portal for XDG Desktop” subgroup, and search for “Implement freedesktop colorscheme preference” in the merge requests (sorry, but I’m not allowed to post a link).

The current code only looks at the GTK theme name. Provided they don’t introduce extra dependencies, patches that add support for other environments are welcome.