8

I use one of default themes - Yaru-dark Gtk Theme. I installed it via flatpak as well. The application id is org.gtk.Gtk3theme.Yaru-dark. Some apps that I installed via flatpak follow it, but others do. I noticed, that apps that do not follow it use Gtk4 & libadwaita, so that might be the cause. Is there a way to make also the other apps use the system theme? I tried looking for org.gtk.Gtk4theme.Yaru-dark on flathub, but there is none.

$ flatpak remote-ls flathub | grep -i yaru-dark
Yaru-dark Gtk Theme org.gtk.Gtk3theme.Yaru-dark     3.22

For example baobab uses gtk4 and does not follow the system theme, while mypaint uses gtk3 and follows the system theme.

baobab mypaint

matusf
  • 351

4 Answers4

11

As of now, the flatpak Gtk4 apps only support Adwaita, Adwaita-Dark and Yaru-* (if installed) themes, but there is a workaround.

You can set all GTK-4 apps to use it. To do that, you need to set the theme for non-flatpak GTK3 and GTK4 apps and for flatpak apps using GTK3 and GTK4.

Non-flatpak GTK-3 apps

Use gnome-tweaks. Change it in the appearance section.

Non-flatpak GTK-4 apps

Set an option in your theme's installer to use libAdawita. The theme that I use (Orchis) has this option. If it doesn't, or does not have an installer, copy the files in ~/.themes/[Your-Theme]/gtk-4/ or /usr/share/themes/[Your-Theme]/gtk-4.0/ (where Your-Theme is the name of your theme) to ~/.config/gtk-4.0/. You'll have to override the default Adawita stuff there, so back it up if you're concerned.

Flatpak GTK-3 apps

Install your theme from Flathub:

flatpak install org.gtk.Gtk3theme.Yaru-dark

(in this example, we use Yaru-dark)

If your theme is not not on Flathub (it likely isn't), you can use these commands to allow them to read the folders, and use your theme.

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

(the latter command will also allow them to use your icon and cursor packs)

Flatpak GTK-4 apps

Give apps permissions to access it and set the GTK_THEME environment variable for them. I used flatseal, but it can be done via flatpak cli.

The /usr/share/themes/ folder is blacklisted in Flatpak, so that can't be set. I've tried symlinks, but they don't work. You have to copy (or move) the theme to ~/.themes/ or another folder you store your themes in.

sudo flatpak override --filesystem=$HOME/.themes/
sudo flatpak override --env GTK_THEME=Yaru-Dark
matusf
  • 351
2

As users, we need a little patience sometimes. Ubuntu creates Yaru, and Ubuntu creates Snap. For Snap packages, they adopted to have the Yaru appearance for apps that use libadwaita (GTK4). Had they adopted Flatpak instead, it would already work for Flatpak.

We are not this far yet. This is Free Software, so once someone creates the flatpak, it will work.

vanadium
  • 97,564
1
Dark versus Light Mode Adherence

Per reddit.com/r/kde/comments/ujqih9:

#!/usr/bin/env sh
sudo flatpak override --system \
    --filesystem=xdg-config/gtk-3.0:ro \
    --filesystem=xdg-config/gtkrc-2.0:ro \
    --filesystem=xdg-config/gtk-4.0:ro \
    --filesystem=xdg-config/gtkrc:ro \
Colour Scheme (and Application Style) Adherence

For GTK3, installing an equivalent Flatpak theme, like org.gtk.Gtk3theme.Breeze, would also apply. Note that for Breeze in KDE Plasma 6, you do still need org.gtk.Gtk3theme.Breeze-Dark, too, but this doesn't apply to GTK4.

For GTK4, you instead should merely follow github.com/flatpak/flatpak/issues/4605 to be notified when this is supported.

0

Cleaning override and copying themes to ~/.themes worked for me perfectly.

sudo flatpak override --reset
cp -r /usr/share/themes ~/.themes
Jurakin
  • 101