Following THIS answer:
- create any folder
path/to/FOLDER
- create a
/share/themes/
folder inside it (that is path/to/FOLDER/share/themes
).
- put your app-specific GTK3 theme inside the latter
- rename the theme to the name of the CURRENTLY ACTIVE THEME.
Use this command to launch the application with the renamed theme instead of the currently active one:
GTK_DATA_PREFIX=path/to/FOLDER YOUR_APPLICATON
The path after GTK_DATA_PREFIX=
has to be only to the folder that contains /share/themes/RENAMED_THEME
, not to the theme itself
To have that inside a launcher, replace accordingly:
Exec=sh -c 'GTK_DATA_PREFIX=path/to/FOLDER YOUR_APPLICATION'
or
Exec=env GTK_DATA_PREFIX=path/to/FOLDER YOUR_APPLICATION
For VLC:
Exec=sh -c 'GTK_DATA_PREFIX=path/to/FOLDER /usr/bin/vlc --started-from-file %U'
or
Exec=env GTK_DATA_PREFIX=path/to/FOLDER /usr/bin/vlc --started-from-file %U
The change can be made in the desktop file in /usr/share/file/applications
or in one copied in ~/.local/share/applications
.
Changing the system theme will reset the per-application theme, until the the folder of the latter is renamed to match the name of the former.
Exec=
line)<application>
as the executable, butenv
:env GTK_THEME=<theme> <application> <switches>
. usingenv
sets the environment variables specified and then launches the application. – quixotic Nov 27 '17 at 16:09Exec=
needsenv
and some applications work this way, some don't (as stated in that answer:some gtk+ 3 applications might not (yet) honor the GTK_THEME env variable
, which gives as example Nautilus). As said in my comment thereunder on what I tested as working: synaptic, gdebi, transmission-gtk, uget-gtk, basic text editors work. Thunar and Pcmanfm do not, neither do VLC and Libreoffice. I will edit my question here too. – Nov 27 '17 at 16:28env
variable can be replaced (and can replace)sh -c
for the given purpose and thus works with my answer here based on this one: https://askubuntu.com/a/427440/47206. – Nov 27 '17 at 16:48