Theming GNOME programmatically (gsettings, GTK CSS, wallpapers, extensions)
gnomegsettingsdconfgtk4libadwaitacssextensionsthemerize
A GNOME "look" is spread across several stores: gsettings keys (themes, fonts, wallpaper, color scheme), CSS overrides for GTK 4 and GTK 3, per-app dconf (GNOME Console), and GNOME Shell extensions with their own dconf trees. A theme manager (Justin's Themerize, Python + GTK4/libadwaita, zero pip deps, written for Arch + GNOME 49) captures all of these as one JSON profile and applies, verifies, and reverts them.
The stores
gsettings keys
- org.gnome.desktop.interface: gtk-theme, icon-theme, cursor-theme, color-scheme (default/prefer-dark), font-name, monospace-font-name; also enable-animations, accent-color (GNOME 46+), cursor-size, text-scaling-factor.
- org.gnome.desktop.background: picture-uri, picture-uri-dark, primary-color, color-shading-type.
- org.gnome.desktop.wm.preferences: theme, button-layout, focus-mode, num-workspaces.
- org.gnome.mutter: edge-tiling, center-new-windows, dynamic-workspaces, experimental-features (e.g. scale-monitor-framebuffer).
GTK CSS: libadwaita color variables overridden in ~/.config/gtk-4.0/gtk.css (and gtk-3.0/gtk.css). Apps must be reopened to pick changes up.
Shell CSS: a full shell theme at ~/.themes/<name>/gnome-shell/gnome-shell.css that @imports the stock one, or a user-stylesheet extension loading ~/.config/gnome-shell/gnome-shell.css. Reload with Alt+F2 rt on X11; Wayland needs a logout.
Animation speed: GNOME_SHELL_SLOWDOWN_FACTOR=0.4 in /etc/environment (below 1 is faster); test live in Looking Glass (lg): St.Settings.get().slow_down_factor = 0.4.
Extensions
gnome-extensions install --force ext.zip ; gnome-extensions enable UUID ; gnome-extensions list
gsettings set org.gnome.shell enabled-extensions "['a@x', 'b@y']"
dconf dump /org/gnome/shell/extensions/blur-my-shell/ > blur.dconf # capture settings
dconf load /org/gnome/shell/extensions/blur-my-shell/ < blur.dconf # apply
dconf reset -f /org/gnome/shell/extensions/blur-my-shell/
Download zips from the extensions.gnome.org API: /extension-info/?pk=<id>&shell_version=49. On Wayland a newly installed extension is not recognized until you log out and in.
Notable effect extensions: Blur My Shell (blur-my-shell@aunetx), Compiz Windows Effect (wobbly windows), Compiz-alike Magic Lamp, Burn My Windows (28+ open/close effects; profiles in ~/.config/burn-my-windows/profiles/*.conf plus dconf active-profile), Desktop Cube (needs dynamic-workspaces false and a fixed num-workspaces), Just Perfection (hide any shell element), Dash to Dock, Dash to Panel, Coverflow Alt-Tab.
Lessons from building Themerize
- SVG wallpapers render unreliably in GNOME's wallpaper handler. Convert to PNG with
rsvg-convert, cache, and regenerate only when the SVG is newer. Profile detection must account for that conversion. - If a profile's wallpaper file is missing, skip that key instead of blanking the desktop.
- dconf is strictly typed: GVariant doubles must be written as floats (
0.0, not0) or the write is rejected. - Extension dconf paths use the schema short name (
blur-my-shell), not the extension UUID. - Verify after applying: read gsettings back, check extensions are actually loaded by the shell, check dependencies first (fonts with
fc-match, icon/GTK/cursor theme directories). - GNOME 49 renamed default fonts: Cantarell became Adwaita Sans, Source Code Pro became Adwaita Mono.
- Debounce live preview (150 ms) instead of applying synchronously on every control change.
- A standalone launcher symlinked into
~/.local/binmust resolve itself withos.path.realpath(), notabspath(). - Use
Gtk.ColorDialog;Gtk.ColorChooserWidgetis deprecated. - When copying a base wallpaper to a variant, copy (
shutil.copy2) rather than rename, or the base is lost.
See also
- GNOME Console (kgx) color schemes ("liveries") via dconf
- Designing settings and customization UIs (HIG, NN/g, GNOME patterns)