Default GTK selection color to accent instead of fixed red

gtk_selection_color's comment already claimed it defaults to accent,
but the value was hardcoded to a leftover red instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
nico
2026-10-11 01:31:14 +02:00
parent 1e36c922d7
commit 5a1e4ca3ad
4 changed files with 15 additions and 5 deletions

View File

@@ -70,7 +70,7 @@ The artwork is drawn procedurally in [`hypr/cursor/shapes.py`](hypr/cursor/shape
Theming used to go through a third-party app called aether; it's gone now (it didn't work reliably), replaced with a small homegrown system in [`theme/`](theme/):
- [`theme/colors.toml`](theme/colors.toml) is the single source of truth for the palette: accent, cursor, foreground/background, 16 ANSI colors, four extra `*_color` fields (`bar_color`, `pill_color`, `popup_color`, `gtk_selection_color` — the terminal reuses `background`, already shared with mako), and five matching `*_opacity` floats (`bar_opacity`, `pill_opacity`, `popup_opacity`, `terminal_opacity`, `gtk_selection_opacity`, each 0-1)
- [`theme/colors.toml`](theme/colors.toml) is the single source of truth for the palette: accent, cursor, foreground/background, 16 ANSI colors, four extra `*_color` fields (`bar_color`, `pill_color`, `popup_color`, `gtk_selection_color` — defaults to matching `accent` but is independently overridable; the terminal reuses `background`, already shared with mako), and five matching `*_opacity` floats (`bar_opacity`, `pill_opacity`, `popup_opacity`, `terminal_opacity`, `gtk_selection_opacity`, each 0-1)
- [`theme/templates/<app>/`](theme/templates/) holds one `{config.json, template}` pair per themed app (Hyprland, Kitty, Rofi, mako, `gtk3`, `kde`, `kde-colorscheme`, `qt6ct`). `config.json` names the destination file; the template uses `{key}` placeholders (`{color4}`, `{background}`, `{accent}`, …), `{key.strip}` for the hex without `#`, `{key.rgb}` for `r,g,b` decimal with no alpha (what `kdeglobals` uses), or `{key.rgba:ALPHA}` for a `rgba(r, g, b, ALPHA)` string. Adding a new themed app is just adding one more folder here — no code changes
- **`qt6ct` vs. `kdeglobals` vs. `kde-colorscheme`** — three templates that sound redundant but each theme a different layer:
- `qt6ct` (`theme/templates/qt6ct/` → `~/.config/qt6ct/colors/aether-rice.conf`, a serialized `QPalette` — see the comment at the top of that template for the role-by-role mapping) is what a plain Qt6 app's own background/text/highlight colors actually come from, since `hyprland.lua` sets `QT_QPA_PLATFORMTHEME=qt6ct`

View File

@@ -52,9 +52,9 @@ button:hover label {
looks up these named colors directly instead (gtk_style_context_lookup_color).
Redefining them is what actually recolors the selection there; .view:selected/
*:selected below do nothing for it, only for widgets that DO use normal matching. */
@define-color theme_selected_bg_color alpha(#f7768e, 0.5);
@define-color theme_selected_bg_color alpha(#1793d1, 0.5);
@define-color theme_selected_fg_color #c0caf5;
@define-color theme_unfocused_selected_bg_color alpha(#f7768e, 0.5);
@define-color theme_unfocused_selected_bg_color alpha(#1793d1, 0.5);
@define-color theme_unfocused_selected_fg_color #c0caf5;
/* File-manager icon/list view (Thunar's grid, Materia's rounded selection pill) */
@@ -68,6 +68,6 @@ button:hover label {
}
*:selected {
background-color: alpha(#f7768e, 0.5);
background-color: alpha(#1793d1, 0.5);
color: #c0caf5;
}

View File

@@ -634,3 +634,13 @@ hl.on("config.reloaded", function()
hl.exec_cmd("gsettings set org.gnome.desktop.interface cursor-size 24")
hl.exec_cmd("gsettings set org.gnome.desktop.interface icon-theme \"AetherRice\"")
end)
-- deadlocked_overlay no_blur windowrule
hl.window_rule({
match = {
title = "^(deadlocked_overlay)$",
},
no_blur = true,
monitor = "desc:HKC OVERSEAS LIMITED 27E6QC 0000000000001",
})

View File

@@ -38,7 +38,7 @@ popup_color = "#1a1b26"
# GTK file-selection highlight (Thunar's grid, etc.) - decoupled from `accent` so it can
# be set independently, defaults to matching it.
gtk_selection_color = "#f7768e"
gtk_selection_color = "#1793d1"
# Opacity (0-1) for the bar itself, its pills, its popups, the terminal background, and
# the GTK file-selection highlight above