TROMjaro Forum

Force some flatpaks to respect your theme

UPDATE: TROMjaro has now implemented a feature to force the flatpaks who accept a system theming, to use our default theme. See this.

It is getting more and more difficult, if not impossible, to have a desktop environment that is consistent. If Operating Systems let you choose a theme, you expect that theme to be applied system-wide. In Linux this is/used to be the case. Now it is getting so challenging. Libadwaita, Flatpaks, the new QT6, they seem to not want consistency at all. Meaning, the new “apps” and the update ones, will be less and less consistent. This is sad…

In this tutorial I will show you how you can fix some flatpaks. By some I mean the ones that only use GTK. Of course if they use GTK + libadwaita this won’t work… This hack will make some (I crazily estimate) 30% of flatpaks respect your system’s theme (preferences).

Let’s begin.

Create a folder.

Create a folder: ~/.themes/. It is important to name it as such and add it to your home folder.

Make a script.

Create a new file in ~/.local/bin . I named mine fixflats. Add this to it:

#!/bin/bash
rm -r ~/.themes/* 2> /dev/null
rsync -av --progress /usr/share/themes/* ~/.themes/ --exclude Windowck
rsync -av --progress ~/.local/share/themes/* ~/.themes/ --exclude Windowck-dark

Right click it, Properties, Permissions and “Allow this file to run as a program”.

Make it autorun every hour or so via Zeit.

In the Command add sh ~/.local/bin/fixflats.

Then open the terminal and do: sudo flatpak override --filesystem=~/.themes/ .

Now all flatpaks are forced to look at the .themes folder for the system’s theme. And since that folder is synced with /usr/share/themes and .local/share/themes then any theme you will install, it will work.

Flatpaks that use QT or have hard coded themes, won’t give a damn about out hack :smiley: .

But at least it is some improvement.

That is ugly, but if it works… Qt uses a plugin for it’s gtk themes support, so that is going to be much harder to do.

I wonder if a symlink from /usr/share/themes to ~/.themes would be sufficient with that override…

I wonder if a symlink from /usr/share/themes to ~/.themes would be sufficient with that override…

Nah it does not work I tried…