GTK Dark Mode on Void Linux

[Void Linux]

If you already have GTK (GTK3/4) by itself or 'cause of an application like Firefox which is built with GTK, the best approach in my opinion is just utilizing the native dark theme.

Get these

sudo xbps-install -S gsettings-desktop-schemas gnome-themes-extra

Open or create ~/.config/gtk-3.0/settings.ini (and/or ~/.config/gtk-4.0/settings.ini) with nano or whatever editor you use and paste these

For GTK3:

[Settings]
gtk-theme-name = Adwaita-dark
gtk-application-prefer-dark-theme = 1

For GTK4:

[Settings]
gtk-application-prefer-dark-theme = 1

Then set the global preference

gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

And for within flatpaks

flatpak override --user --env=GTK_THEME=Adwaita:dark
flatpak override --user --env=COLOR_SCHEME=prefer-dark