Change theme on application level

My eyes don’t like dark theme. Unfortunately, Gnome-Boxes & Cheese come by default with as dark themed and they don’t offer a configuration option to change it.

I have tried this:

Exec=env GTK_THEME=Adwaita:light gnome-boxes %U

in:

.local/share/applications/org.gnome.Boxes.desktop

but it has no effect.

Does anyone has a solution/idea about it?

1 Like

Can you try with
Exec=env GTK_THEME=Adwaita gnome-boxes %U

Edit: I also tried with Exec=env GTK_THEME=Adwaita:light with pavucontrol app and both works on my sistem.

2 Likes

Nope! Still comes up dark themed.
The same happens with Cheese, gThumb, etc

EDIT

Hmmm, weird, i opened a terminal and typed

GTK_THEME=Adwaita gnome-boxes

and the app open with light theme.

Is it possible that it doesn’t read .local/share/applications directory?

FINAL EDIT

The only way it works for me is if i use Exec=bash -c 'GTK_THEME=Adwaita gnome-boxes %U'

But this creates a duplicate app icon. The default open the app in dark theme. The custom opens the app in light theme.

I decided to go with bash alias alias Boxes="GTK_THEME=Adwaita gnome-boxes" and then i type Boxes in a terminal window.

desktop-file-install \
--dir=${HOME}/.local/share/applications \
--set-key=Exec \
--set-value="$(sed -n -r -e \
"s|^Exec=(.*)$|env GTK_THEME=Adwaita \1|p" \
/usr/share/applications/org.gnome.Boxes.desktop)" \
--remove-key=DBusActivatable \
/usr/share/applications/org.gnome.Boxes.desktop

https://wiki.gnome.org/HowDoI/DBusApplicationLaunching

1 Like

This has a weird effect. The desktop icon still opens Boxes in dark theme but if i type
Super + Boxes + Enter the app opens is light theme.

EDIT
It looks that it was a caching issue. I ran sudo update-desktop-database && reboot and now it works fine.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.