poiuy
(Nob Ody)
July 13, 2024, 8:07am
1
I installed Geany and it is not taking the system dark theme, instead it always has the bright theme, as you can see in the following screenshot:
I tried different installations of Geany: from the Software app, sudo dnf install geany
, etc., and in all cases the same happens.
Is there a solution to this? I am using Fedora 40 installed 2 weeks ago.
vgaetera
(Vladislav Grigoryev)
July 13, 2024, 9:01am
2
1 Like
poiuy
(Nob Ody)
July 13, 2024, 10:14am
3
This seems to work for permanent dark mode, but I want Geany (and all apps) to follow the dark/light theme from the top right Gnome menu.
poiuy
(Nob Ody)
July 13, 2024, 10:53am
5
Ok. In Ubuntu 22.04 it worked though, that’s why I was wondering maybe there is some setting to be touched.
vgaetera
(Vladislav Grigoryev)
July 13, 2024, 11:21am
6
Here’s a workaround:
mkdir -p ~/.local/bin
tee ~/.local/bin/gtk-theme-variant << "EOF" > /dev/null
#!/usr/bin/awk -f
BEGIN{FS="\\s+"
color_get="gsettings monitor org.gnome.desktop.interface color-scheme"
theme_get="gsettings get org.gnome.desktop.wm.preferences theme"
theme_set="gsettings set org.gnome.desktop.interface gtk-theme"
while(color_get|getline){
theme_get|getline theme
close(theme_get)
gsub(/\x27/,"",theme)
sub(/default|prefer/,theme)
system(theme_set" "$2)}
close(color_get)}
EOF
chmod +x ~/.local/bin/*
mkdir -p ~/.config/systemd/user
tee ~/.config/systemd/user/\
gtk-theme-variant.service << EOF > /dev/null
[Unit]
Description=GTK theme variant service
[Service]
ExecStart=%h/.local/bin/gtk-theme-variant
[Install]
WantedBy=gnome-session.target
EOF
systemctl --user daemon-reload
systemctl --user enable gtk-theme-variant.service
systemctl --user restart gtk-theme-variant.service
3 Likes
ledeni
(Igor Bezrodnik)
July 13, 2024, 12:44pm
7
Install tweaks and select Appearance – Legacy Applications – adwaita dark mode (make sure you install themes-extra like sudo dnf install gnome-themes-extra)
tqcharm
(Mike B.)
July 13, 2024, 1:28pm
8
Apparently there are some (bot not all) legacy gtk applications, which don’t follow system theme (light/dark).
E.g. Geary (gtk3) doesn’t follow system theme, whereas Evince, Terminal do.
gparted for me never does either. . .
Igor Bezrodnik:
Install tweaks
I have founf that Gradience works pretty well too
tqcharm
(Mike B.)
July 14, 2024, 12:41am
11
It seems that all the legacy gtk apps which come preinstalled do follow system theme, but the other ones don’t (or at least some of them don’t). I will test with a few other ones tomorrow, to see if this is a rule.
I wonder if every legacy gtk app has to be manually tweaked, which would explain why the focus is only on the preinstalled ones.
1 Like
boredsquirrel
(boredsquirrel)
Tags updated
July 18, 2024, 11:30am
12
poiuy
(Nob Ody)
November 13, 2024, 1:12pm
13
For completeness, don’t forget to also install
sudo dnf install gnome-themes-extra
for this to work.
poiuy
(Nob Ody)
November 13, 2024, 1:18pm
14
@vgaetera do you know how to automate the change in the color scheme as well? I mean, automate “View→Change color scheme” within Geany.
litemotiv
(Olivier)
November 13, 2024, 1:37pm
15
P.s. a simple method to launch Geany or any other legacy GTK app in dark mode is:
$ GTK_THEME=Adwaita:dark geany