Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Change a certain program GTK theme

Writer 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:

Spotify window with the 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

1 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy