2

Can I change a certain application's GTK theme that would differ from the system set one?

I'd like to change Spotify's theme to be Qogir-black, but keep everything else on Qogir-light (two different theme folders) I want spotify window to have a black header.

Now it looks like this with a white header:

When I change the system theme (in GNOME Tweaks) to dark, the Spotify header changes. So the problem is not in the theme.

I tried changing the /usr/share/applications/spotify.desktop file to this:

[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Music Player
Icon=spotify-client
#TryExec=spotify
Exec=env GTK_THEME=Qogir-dark spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

I followed this tutorial here but it didn't do the thing.

2
  • I guess the trick with setting the GTK_THEME variable only works for theming GTK3 applications, like nautilus, gedit, etc. It will not work on conventional ("legacy") window decoration and GTK2 applications such as Gimp. Not sure if for GTK2 themes can be changed on a per-app basis.
    – vanadium
    Sep 23, 2018 at 15:06
  • @vanadium For gtk2 apps, I think you can use the gtkrc file and set the environment variable for that instead like in this answer.
    – mchid
    Jan 11, 2020 at 1:22

2 Answers 2

2

I have found a solution that seems to work. Put in /usr/local/bin a file named spotify Open it with gedit and type

#!/bin/bash
/bin/spotify & 
sleep 0.2
xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT "dark" -id $(xdotool getactivewindow)

type sudo chmod a+x /usr/local/bin/spotify for permissions

It needs xdotool to get spotify window id.

It works! I know that after a year it's a bit too late

0

This worked for me on the kde desktop environment using the application lyx and following the instructions on this reddit link:

One can copy the color settings of another theme (in kde for me the color settings for installed themes was in ~/.local/share/color-schemes). In the kde desktop environment I can just copy the whole file, not sure if that works with gnome or another desktop environment.

Then, for the lyx app, one can paste the copied text at the end of lyxrc file in ~/.config (for an app called foo it would be foorc but maybe this file would need to be created according the link above) (one should probably save a copy of the original file with a modified name or in another folder before), save the file and that's it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .