Geany not changing to dark mode

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.

How to configure VMM to use dark theme - #3 by vgaetera

1 Like

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.

Ok. In Ubuntu 22.04 it worked though, that’s why I was wondering maybe there is some setting to be touched.

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

Install tweaks and select Appearance – Legacy Applications – adwaita dark mode (make sure you install themes-extra like sudo dnf install gnome-themes-extra)

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. . . :rage:

I have founf that Gradience works pretty well too

Added gtk, workstation

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

Added legacy-apps, theming

For completeness, don’t forget to also install

sudo dnf install gnome-themes-extra

for this to work.

@vgaetera do you know how to automate the change in the color scheme as well? I mean, automate “View→Change color scheme” within Geany.

P.s. a simple method to launch Geany or any other legacy GTK app in dark mode is:

$ GTK_THEME=Adwaita:dark geany