Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 3328  / 2 Years ago, sun, july 10, 2022, 11:36:19

Is this possible to apply Adwaita Dark theme only to some applications?



I want to enable it for the Terminal and maybe Nautilus but not other applications, because Opera and Software Center and possibly other non GTK applications look ugly/unreadable with Adwaita Dark theme.


More From » gnome

 Answers
5

For GTK2 apps, the way to do this was relatively simple. You can launch a gtk2 app with a custom theme like this:



GTK2_RC_FILES=(path-to-theme) (command)


So for example, this worked:



GTK2_RC_FILES=/usr/share/themes/Redmond/gtk-2.0/gtkrc catfish


(Catfish is an app I know to be gtk2 -- you may not have it installed.)



Unfortunately, this feature broke entirely in GTK3. I can't gaurantee this will work perfectly, but you could try making simple shell scripts that configure a theme, launch the app, then unconfigure the theme. If you launch two apps at the same time, that my result in a race condition with unpredictable results.



So for example, you could launch gedit like this:



#!/bin/sh
if [ -h ~/.config/gtk-3.0 ]
then
rm ~/.config/gtk-3.0
fi
ln -s /usr/share/themes/HighContrast/gtk-3.0 ~/.config
gedit "$@" &
sleep 1
if [ -h ~/.config/gtk-3.0 ]
then
rm ~/.config/gtk-3.0
fi


Besides the race condition, doing this has some other undesirable side-effects. For one, you'll use more memory for each application that has its own theme. For another, you'll have to write custom shell scripts and launchers for each app. Finally, in my opinion, your desktop will look weird.



But there. That's how you can do it, sort of.


[#41588] Sunday, July 10, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
naldis

Total Points: 257
Total Questions: 101
Total Answers: 111

Location: Kenya
Member since Sat, Feb 25, 2023
1 Year ago
naldis questions
;