Give libadwaita applications the desktop's accent

Files, Papers, Loupe and every other libadwaita application read their
accent from the Settings portal, so they rendered in GNOME blue no
matter which accent this desktop was set to -- correct on our own
surfaces, wrong on half the screen.

xdg-desktop-portal-gtk cannot serve org.freedesktop.appearance
accent-color at all; the string does not appear in the 1.15.3 binary.
The gnome backend serves it, so Settings now routes to gnome with gtk
still listed behind it -- the frontend merges Settings backends in
order, so color-scheme keeps resolving if the gnome backend is ever
unavailable.

GNOME's accent-color is a fixed enum of nine names rather than a color,
so each of our eight accents carries its nearest member. Nearest by hue
rather than by name: rose maps to red, because it is the red role in
this palette.

Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
Gabriel Brown
2026-08-19 09:31:50 -04:00
parent 1b94af1163
commit 91306ce810
5 changed files with 198 additions and 18 deletions
+12 -7
View File
@@ -170,13 +170,18 @@ Singleton {
`hl.config({ general = { col = { active_border = ${activeBorder} } } })`]);
// Applications that predate org.freedesktop.appearance and carry
// their own palettes -- terminals, chiefly. Everything that reads
// the portal (GTK4, Qt6, Chromium, Electron) is already handled by
// the gsettings write above and needs nothing here. The accent is
// passed through too: kitty's border and the hyprlock fallback
// template are also the accent role, not just the scheme -- so
// this still has to run on an accent-only change, even though the
// scheme-relative work it also does is then redundant.
// their own palettes -- terminals, chiefly. Portal readers (GTK4,
// Qt6, Chromium, Electron) already have their SCHEME from the
// gsettings write above.
//
// Their ACCENT does not come from here: GNOME's accent-color is a
// fixed enum of nine names rather than a color, so the mapping from
// our eight lives in panama-theme-apps beside the other per-
// application translations. The accent is passed through for that,
// and because kitty's border and the hyprlock fallback template are
// the accent role too -- so this still has to run on an accent-only
// change, even though the scheme-relative work it also does is then
// redundant.
commands.push([root.appThemePath, root.dark ? "dark" : "light", accentName]);
}