If you’re using GNOME, you’ve probably noticed something annoying: when you flip between dark and light mode in GNOME, most apps change — except the older (“legacy”) ones. Those legacy apps, built on GTK2 or plain GTK3, often ignore GNOME’s new color-scheme toggle. It’s weird. It’s inconsistent. We can fix it.
What’s happening under the hood
GNOME’s dark/light switch triggers for modern apps (GTK4 or GTK3 with libadwaita), but older apps stick to whatever GTK theme they were told at startup. So: you switch the system theme → modern apps obey → legacy ones stay in the old theme → ghost town.
The trick: Monitor GNOME’s color-scheme setting, and when it changes, swap your GTK theme manually for those legacy apps.
Create the theme-sync script
Open your terminal, then run:
1
2
mkdir -p ~/.local/bin
nano ~/.local/bin/gnome-theme-sync.sh
Paste this script:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# put your actual theme names here
LIGHT_THEME="adw-gtk3"
DARK_THEME="adw-gtk3-dark"
# Stop any old monitor instances
pkill -f "gsettings monitor org.gnome.desktop.interface color-scheme" 2>/dev/null
# Start listening for color-scheme changes
gsettings monitor org.gnome.desktop.interface color-scheme | while read -r line; do
if echo "$line" | grep -q "dark"; then
gsettings set org.gnome.desktop.interface gtk-theme "$DARK_THEME"
echo "Switched to dark theme: $DARK_THEME"
else
gsettings set org.gnome.desktop.interface gtk-theme "$LIGHT_THEME"
echo "Switched to light theme: $LIGHT_THEME"
fi
done
Then:
1
chmod +x ~/.local/bin/gnome-theme-sync.sh
This watches GNOME’s color-scheme key. Whenever you switch to dark or light mode, it applies the matching GTK theme for legacy apps. Boom.
Autostart the script after login
Since Void Linux uses runit (and not systemd for per-user services), the easiest way is to add this script to your session’s autostart.
Create an autostart file:
1
2
3
4
5
6
7
8
9
10
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/gnome-theme-sync.desktop <<EOF
[Desktop Entry]
Type=Application
Exec=$HOME/.local/bin/gnome-theme-sync.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=GNOME Theme Sync
EOF
Now when you log in, the script will start and stay running in the background.
Verify the theme names are correct
You’re almost there. But it only works if the theme names you used are exactly what your system recognises. To check:
- Run this to see which GTK theme is currently active:
1
gsettings get org.gnome.desktop.interface gtk-theme
- List installed themes:
1 2
ls /usr/share/themes ls ~/.themes
-
If your script uses
adw-gtk3-dark(for dark mode) andadw-gtk3(for light mode) — but you don’t see folders with those exact names — you’ll want to adjust. - Quick test:
1 2 3
gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3-dark' sleep 1 gsettings set org.gnome.desktop.interface gtk-theme 'adw-gtk3'
If you get “No such theme: …” or no visible change, your theme names might differ.