Overwrite the default GTK theme per application

I love using a dark theme on my system, currently I’m running the Adapta theme. But not all applications looks great in dark themes, some need tweaking, this is a quick hack to overwrite the default theme used for a specific application.

In this example I’ll be overwriting the theme for virt-manager.

First we’ll copy the default launcher/desktop file to the local dir, and then we will change that file,

sudo cp /usr/share/applications/virt-manager.desktop /usr/local/share/applications/virt-manager.desktop
sudo vim /usr/local/share/applications/virt-manager.desktop

And do this small change, prefix the application Exec command with env GTK_THEME=theme_name

--- /usr/share/applications/virt-manager.desktop 2018-02-28 22:48:50.000000000 +0200
+++ /usr/local/share/applications/virt-manager.desktop 2018-07-09 11:00:40.000000000 +0300
@@ -55,7 +55,7 @@
Comment[sv]=Hantera virtuella maskiner
Comment[uk]=Керування віртуальними машинами
Icon=virt-manager
-Exec=virt-manager
+Exec=env GTK_THEME=Adapta virt-manager
Type=Application
Terminal=false
Categories=System;

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *