Change a certain program GTK theme
Sebastian Wright
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=spotifyI followed this tutorial here but it didn't do the thing.
21 Answer
I have found a solution that seems to work.
Put in /usr/local/bin a file named spotifyOpen 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