[HOW TO] apply your custom GTK-theme to Flatpaks

Flatpak is a bit limited in what it can access, but you can use your preferred custom GTK theme on Zorin OS 15 or Zorin OS 16 flatpaks.
There are a couple of caveats.

  • The theme in question must be located in your Home .themes directory. Flatpak is utterly blocked, by design, from accessing /usr/share/themes
  • The theme will not change when you use your Themes or Settings manager to switch themes. You must manually use CLI to go in... and change it, too.

First, create (if it does not exist already) a home themes directory by right clicking an open area within your File Manager in Home and creating a new folder. Name it .themes
Now, move or extract your custom gtk themes into that directory.
Give flatpak access:

sudo flatpak override --filesystem=$HOME/.themes

Now that it has been given permission to view a directory on your system that you use...
You can instruct it which theme to use. Remember, this is the only way, currently, to tell flatpak to use a theme other than the one it wants to use. So if you switch themes later, you must repeat this. Replace THEME-NAME with the exact theme name as it appears in your .themes directory.

sudo flatpak override --env=GTK_THEME=THEME-NAME

Kill any flatpak applications running and relaunch and they should now be sporting a new look.

Revert all changes with:

sudo flatpak override --reset

3 Likes