Toggle Light & Dark Mode for Flatpak Apps in Ubuntu 20.04+ / Linux Mint

Using Flatpak apps in Linux? You may found that Flatpak app appearance does not change when toggling light & dark mode or switching to another app theme.

As more and more apps publish Linux packages via Flatpak, I have a few of them installed in my Ubuntu laptop. However, the apps stick to the light theme whenever I switches to dark mode in Appearance settings.

Since Flatpak runs in sandbox and does not have permission to access the “/usr” directory, it does not use system theme according to the document. So, some popular GTK themes are packaged as Flatpaks. And, it detects the current system app theme and tries to install the Flatpak version of the theme if available during app installation or update.

I’m working with default Yaru theme in the most time, so it automatically installs Yaru theme flatpak package but leaves Yaru Dark not installed. When I switching to Yaru Dark, it can’t find the match theme so falls back to the default Adwaita.

Install GTK Themes in Flatpak:

As all I said, the solution is install the themes you use as Flatpak packages.

For Ubuntu 20.04 and higher that use the default Yaru app theme, press Ctrl+Alt+T on keyboard to open terminal and run command:

  • Install the Dark theme by running command:
    flatpak install flathub org.gtk.Gtk3theme.Yaru-dark
  • Or install the light theme if not exist via command:
    flatpak install flathub org.gtk.Gtk3theme.Yaru-light

There are also elementary stylesheet, Deepin GTK theme, Linux Mint’s Mint-Y in different colors, Arc, Numix, and other themes in Flatpak package format. You can find more themes via command:

flatpak search gtk3theme

Then install your prefer theme via “flatpak install flathub app-id” command.

After that, change app theme via Gnome Tweaks or System Settings to see the magic!

Make theme working for Qt apps:

Though I don’t have Qt applications as Flatpaks, according to the document, you need to open terminal and run following commands one by one to install the required runtime libraries:

flatpak install org.kde.KStyle.Adwaita
flatpak install org.kde.PlatformTheme.QGnomePlatform

That’s all. Enjoy!