Make Nautilus and other GTK4/libadwaita apps follow the Omarchy theme
Checked on this workstation (omarchy 4.0.2-1, gtk4 1:4.22.4-1, libadwaita 1:1.9.3-1, nautilus 50.2.2-1). Three claims held and three did not. Held, and confirmed on this machine: nothing in the Omarchy tree writes a GTK palette, because the only GTK CSS template under /usr/share/omarchy/default/themed is hyprland-preview-share-picker.css.tpl and no theme directory ships a GTK file. Held: the hook path is real, since omarchy-theme-set calls omarchy-hook theme-set "$THEME_NAME" and omarchy-hook runs every file in ~/.config/omarchy/hooks/theme-set.d/. Held, and confirmed from GTK source rather than locally: gtk_settings builds one static GtkCssProvider, calls gtk_css_provider_load_from_path on ~/.config/gtk-4.0/gtk.css and registers no file monitor, so the file is read once per process, and nautilus is D-Bus activated as /usr/bin/nautilus --gapplication-service. Wrong, confirmed on this machine: the symptom said no colour change at all, but /usr/share/omarchy/bin/omarchy-theme-set-gnome sets color-scheme, gtk-theme and icon-theme from the theme, and with the gruvbox theme active gsettings get org.gnome.desktop.interface icon-theme returns Yaru-olive, exactly the content of /usr/share/omarchy/themes/gruvbox/icons.theme, so light or dark and the icon set do follow the theme. Wrong, from sources: the cause called @define-color the only lever, but libadwaita 1.9.3 documents CSS custom properties on :root as the override mechanism, and GTK 4 documentation states that define-color is deprecated and that custom properties, the :root selector and var() should be used instead, supported since 4.16. The old form still works only because libadwaita's compiled stylesheet declares the legacy names and maps each one forward as --window-bg-color: @window_bg_color, which I read out of the installed /usr/lib/libadwaita-1.so.0. Wrong, from source: the GTK3 note blamed provider scoping, but gtk_style_cascade_get_color in both gtk-3-24 and gtk4 main walks providers from the highest priority down, and the user stylesheet sits at GTK_STYLE_PROVIDER_PRIORITY_USER above libadwaita's GTK_STYLE_PROVIDER_PRIORITY_THEME, so an override does reach the theme. The real obstacle is that GTK3's compiled Adwaita declares 163 named colours and then references only @theme_text_color five times and @selected_bg_color three times, counted in the installed /usr/lib/libgtk-3.so.0, so there is almost nothing for an override to reach. I also replaced the sed reader with omarchy-theme-color, the supported colors.toml reader that omarchy-theme-set-gnome and omarchy-theme-set-templates both use, and confirmed omarchy-theme-color --file ~/.local/state/omarchy/current/theme/colors.toml background returns #282828 here. Both cited issues were read in full and both support the record, although 7557 is an open feature request whose prose the record reproduced including the two errors above, and 8380 is a separate transparency report about a user's own broken hook. NOT exercised: I did not write gtk.css, install the hook, change the theme, restart any app or render anything, so the visual result of the corrected CSS is unverified on this machine and rests on the libadwaita documentation.
The hook overwrites ~/.config/gtk-4.0/gtk.css on every theme change. Omarchy itself never writes that file, so nothing but this hook will clobber it, but if you already hand-maintain it, back it up first or have the hook write a separate file and @import it. The hook also sends SIGTERM to GTK4 daemons. All of them are D-Bus activatable and respawn on demand, but an unsaved dialog in one of them is lost.
Symptom
Every theme applies to the terminal, bar, launcher and lock screen, but Nautilus and other GTK4/libadwaita apps keep stock Adwaita colours. Running omarchy theme set gruvbox and then omarchy theme set tokyo-night leaves the Nautilus window, header bar and sidebar the same grey both times. Two GTK-visible things do change on every theme set, so this is not "nothing happens": omarchy-theme-set-gnome writes org.gnome.desktop.interface color-scheme to prefer-dark or prefer-light from the theme's mode, sets gtk-theme to Adwaita or Adwaita-dark, and sets icon-theme from the theme's icons.theme. What never follows the theme is the palette.
Cause
Nothing in Omarchy writes a GTK palette. The only themed GTK CSS template in the whole tree is /usr/share/omarchy/default/themed/hyprland-preview-share-picker.css.tpl, for the Hyprland share picker, and no theme under /usr/share/omarchy/themes/ ships a GTK file. What omarchy-theme-set does run is omarchy-theme-set-gnome, and that only flips org.gnome.desktop.interface between color-scheme prefer-dark with gtk-theme Adwaita-dark and the light pair, plus icon-theme from the theme's icons.theme. libadwaita ignores gtk-theme by design, so even the theme name is inert for these apps and only the light or dark preference lands.
The user-level lever that does work is the GTK user stylesheet, ~/.config/gtk-4.0/gtk.css. GTK4 adds it at GTK_STYLE_PROVIDER_PRIORITY_USER and libadwaita registers its own stylesheet at GTK_STYLE_PROVIDER_PRIORITY_THEME, so rules in the user file win. On libadwaita 1.9.3 the documented way to override a colour is a CSS custom property on :root, for example --window-bg-color. The older @define-color window_bg_color form still works, because libadwaita's compiled stylesheet declares the legacy names and maps each one forward, but GTK deprecated @define-color in 4.16 in favour of custom properties, :root and var().
Compounding it, GTK4 loads that file exactly once per process. gtk_settings builds a single static GtkCssProvider, calls gtk_css_provider_load_from_path on it if the file exists, and installs no file monitor. Apps that run as --gapplication-service daemons survive their last window closing, so they keep painting a days-old palette after you rewrite the CSS.
Fix
Write the libadwaita overrides yourself and re-apply them on every theme change. Omarchy never writes ~/.config/gtk-4.0/gtk.css, so nothing else competes for that file and nothing overwrites your copy except this hook.
mkdir -p ~/.config/omarchy/hooks/theme-set.d
cat > ~/.config/omarchy/hooks/theme-set.d/20-gtk4-colors.sh <<'EOF'
#!/bin/bash
set -uo pipefail
colors="$HOME/.local/state/omarchy/current/theme/colors.toml"
[[ -f $colors ]] || exit 0
# omarchy-theme-color is the supported reader for colors.toml. It resolves
# legacy colorN names and derived shades that a raw sed over the file misses.
bg=$(omarchy-theme-color --file "$colors" background || true)
fg=$(omarchy-theme-color --file "$colors" foreground || true)
[[ -n $bg && -n $fg ]] || exit 0
mkdir -p "$HOME/.config/gtk-4.0"
cat > "$HOME/.config/gtk-4.0/gtk.css" <<CSS
:root {
--window-bg-color: $bg;
--window-fg-color: $fg;
--view-bg-color: $bg;
--view-fg-color: $fg;
--headerbar-bg-color: $bg;
--headerbar-fg-color: $fg;
--sidebar-bg-color: $bg;
--sidebar-fg-color: $fg;
--secondary-sidebar-bg-color: $bg;
--secondary-sidebar-fg-color: $fg;
--dialog-bg-color: $bg;
--dialog-fg-color: $fg;
--popover-bg-color: $bg;
--popover-fg-color: $fg;
}
CSS
# GTK4 loads ~/.config/gtk-4.0/gtk.css once per process and sets up no file
# monitor on it, so a D-Bus activated daemon keeps painting the palette it
# started with. Every name below respawns on demand, so SIGTERM is safe.
pkill -f 'nautilus --gapplication-service' || true
pkill -x geary || true
pkill -x gnome-calendar || true
EOF
chmod +x ~/.config/omarchy/hooks/theme-set.d/20-gtk4-colors.sh
omarchy theme refresh
omarchy-theme-set calls omarchy-hook theme-set "$THEME_NAME" after it swaps the theme in, and omarchy-hook runs every file in ~/.config/omarchy/hooks/theme-set.d/, so the hook fires on every omarchy theme set.
Two deliberate omissions. --accent-bg-color is left alone because libadwaita derives --accent-color from it in the Oklab space, and overriding one without the other gives you accent text with no contrast guarantee. --card-bg-color is left alone because Adwaita defines it as a translucent white overlay (RGB(255 255 255 / 8%) in the dark style), so pinning it to the opaque window background makes every card disappear into the window.
Omarchy 4 versus plain Arch:
- On Omarchy 4 the hook above is the mechanism, because
~/.config/omarchy/hooks/theme-set.d/andomarchy-theme-colorboth exist and a theme change is what needs to trigger the rewrite. - On plain Arch there is no theme-set event. Write the same
:rootblock into~/.config/gtk-4.0/gtk.cssonce by hand and restart the affected apps.
Syntax note. @define-color window_bg_color <hex>; in the same file still works on libadwaita 1.9.3, because its compiled stylesheet still declares the old names and maps them forward with --window-bg-color: @window_bg_color;. It is the older form: GTK deprecated @define-color in 4.16 and its own documentation says to use custom properties, the :root selector and var() instead. Prefer the :root block.
GTK3 apps cannot be recoloured this way, but not for the reason usually given. A user @define-color does reach the theme: GTK3 and GTK4 both resolve a named colour by walking the style cascade from the highest priority provider down, and the user stylesheet sits at GTK_STYLE_PROVIDER_PRIORITY_USER above the theme. The real obstacle is that GTK3's compiled Adwaita declares 163 named colours and then almost never refers to them, so there is nothing for an override to reach. GTK3 apps still need an approximate binary theme selected through gtk-theme.
Verify
Check the file was written with real values and that the apps picked it up:
cat ~/.config/gtk-4.0/gtk.css
Every line must carry a six-digit hex value. An empty # or a bare $bg means omarchy-theme-color returned nothing and the guard did not catch it. Then run omarchy theme set gruvbox, open Nautilus, run omarchy theme set tokyo-night, open Nautilus again, and confirm the window background is visibly different between the two. Opening it twice matters because the daemon has to have been restarted in between.
Sources
- https://github.com/omacom/omarchy/issues/7557
- https://github.com/omacom/omarchy/issues/8380
- https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.9/css-variables.html
- https://docs.gtk.org/gtk4/css-properties.html
- https://wiki.archlinux.org/title/GTK
- https://raw.githubusercontent.com/GNOME/gtk/main/gtk/gtksettings.c
- https://raw.githubusercontent.com/GNOME/gtk/main/gtk/gtkstylecascade.c
- https://raw.githubusercontent.com/GNOME/gtk/gtk-3-24/gtk/gtkstylecascade.c
- https://raw.githubusercontent.com/GNOME/libadwaita/libadwaita-1-9/src/adw-style-manager.c