Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix Flatpak GTK Theming on KDE/XeroLinux
#1
Hey y'all...

Thanks to @Locutus for finding the thread om Manjaro Forums, and @vroger11 on there to have do the research, we now have a potential fix for Flatpaks and theming..

One of the reasons why some users avoid installing Flatpak apps is that most Flatpak apps don’t change their appearance as per the current system theme. This makes the applications look out of the place in your otherwise beautiful set up.

The official way to apply GTK themes to Flatpak apps is by installing the desired theme as a flatpak. However, there are only a few GTK themes that can be installed as Flatpak.

This means that if you found a beautiful GTK theme, your Flatpak applications will still be using their default appearance. But wait! There is a workaround.

In this tutorial, I am going to introduce you a way to make flatpak apps aware of external GTK themes.



To enable this functionality, users need to install the GTK themes similar to the one used in KDE (as for other distros) but also run these commands:

Step 1: Give Flatpak apps access to GTK themes location

GTK themes are located in /usr/share/themes for all users, and in ~/.themes for a specific user. Notice that you can’t give access to /usr/share/themes because according to Flatpak Documentation they are black listed.

So, since all included GTK Themes in XeroLinux  are located under /usr/share/themes which Flatpaks cannot access we need to copy them to ~/.themes .

Once that is done, to give all flatpak packages permission to access ~/.themes run the following command:
sudo flatpak override --filesystem=$HOME/.themes

Step 2: Enable System-Wide Flatpak Override

Now we need to apply a system-wide override telling Flatpaks to use whatever GTK theme system is using, it will be applied by default on next release of XeroLinux if it hasn't been already..

Commands :
sudo flatpak override --filesystem=xdg-config/gtk-3.0:ro
sudo flatpak override --filesystem=xdg-config/gtk-4.0:ro

Also sometimes that alone might not work, so you will need to set specific theme via...
sudo flatpak override org.gnome.Calculator --env=GTK_THEME=name-of-gtk-theme

Once that's done you will end up with a file in the system that includes those values. Seemingly enough there is some info about that exact issue on the Flathub iisue reporter..

As you can see in the screenshot below, there is two themes available, Ant-Bloody and Orchis-dark. Copy and paste the exact theme name in the above command:

[Image: uT6brUj.png]

This only applies to GTK3/4 based packages, for QT in most cases nothing needs to be done Wink

Here's the Original Thread on Manjaro Forums... Oh and This Thread Too....
~ XeroLinux Toolkit Maintainer ~
I do try to help where I can, when I can.
I do this on my own, so I might not have all the answers.
[Image: K7U76Mv.png]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Top 5 Flatpak Tips n Tools DarkXero 1 956 05-25-2023, 03:34 PM
Last Post: AdiHash

Forum Jump:


Users browsing this thread: 1 Guest(s)