Switch file manager to Thunar, fix GTK3 theming from the ground up

Dolphin's selection color is stuck on stock Breeze blue outside a full
Plasma session (unfixed upstream regression, see README) - dropped it
for Thunar. Getting Thunar themed exposed a chain of GTK3-specific
issues fixed along the way: !important is silently rejected by GTK3's
CSS parser (not just deprioritized), the widget and icon themes resolve
via completely different mechanisms under Hyprland (no XSETTINGS
daemon), and Thunar's ExoIconView grid reads its selection color from a
named @define-color instead of normal :selected matching. Folder icon
colors are now generated to match the accent exactly (theme/icon_theme.py,
no sudo) instead of snapping to a papirus-folders preset.

Also adds the kde-colorscheme template (the missing piece
KColorSchemeManager actually resolves ColorScheme= against) and new
gtk_selection_color/gtk_selection_opacity palette keys with widget
controls, following the existing bar/pill/popup color+opacity pattern.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
This commit is contained in:
nico
2026-09-29 01:19:42 +02:00
parent 1ca9812608
commit 823277f535
22 changed files with 573 additions and 99 deletions

View File

@@ -1,43 +1,73 @@
/* FORCE ALL BACKGROUNDS AND TEXT FIELDS TO BLUE ACCENTS */
/* Generated by theme/render.py from the active palette.
Edit the template at ~/.config/theme/templates/gtk3/gtk.css, not the output.
Blanket GTK3 override (applies to every GTK3 app: Thunar, Qalculate-gtk, etc.) - GSettings
(set in hyprland.lua's config.reloaded hook) picks the base Materia-dark theme, this then
forces the actual colors on top of it to match the palette.
No !important: GTK3's CSS parser doesn't support it at all (not "lower priority" -
it drops the whole declaration, "Junk at end of value" in GTK_DEBUG output). This file
is loaded at GTK_STYLE_PROVIDER_PRIORITY_USER, already above the theme's own CSS, so
plain declarations here win without it. */
* {
/* Base text color */
color: #e2e8f0 !important;
color: #c0caf5;
}
/* Main Application Window Backgrounds */
window, dialog, grid {
background-color: #1e222a !important;
background-image: none !important;
background-color: #1a1b26;
background-image: none;
}
/* The Calculator Input Field and History Readout */
entry, textview, textview text, text {
background-color: #16191f !important;
color: #61afef !important; /* Soft Blue text output */
border: 1px solid #00a3ff !important; /* Electric Blue Frame */
border-radius: 6px !important;
box-shadow: none !important;
background-color: #1a1b26;
color: #1793d1;
border: 1px solid #1793d1;
border-radius: 6px;
box-shadow: none;
}
/* Calculator Grid Buttons */
button {
background-color: #282c34 !important;
background-image: none !important;
border: 1px solid #3e4452 !important;
border-radius: 6px !important;
box-shadow: none !important;
background-color: #1a1b26;
background-image: none;
border: 1px solid #565f89;
border-radius: 6px;
box-shadow: none;
}
/* Mouse Hover Actions */
button:hover {
background-color: #3e4452 !important;
border-color: #00a3ff !important;
background-color: #565f89;
border-color: #1793d1;
}
/* Button Labels inside the buttons */
button label {
color: #e2e8f0 !important;
color: #c0caf5;
}
button:hover label {
color: #00a3ff !important; /* Text inside turns electric blue on hover */
color: #1793d1;
}
/* Thunar's grid is ExoIconView, an old custom widget that doesn't ask the style
context "what's my background for :selected" through normal CSS matching - it
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(#7aa2f7, 0.5);
@define-color theme_selected_fg_color #c0caf5;
@define-color theme_unfocused_selected_bg_color alpha(#7aa2f7, 0.5);
@define-color theme_unfocused_selected_fg_color #c0caf5;
/* File-manager icon/list view (Thunar's grid, Materia's rounded selection pill) */
.view {
background-color: transparent;
color: #c0caf5;
}
.view:hover {
background-color: alpha(#1793d1, 0.18);
}
*:selected {
background-color: alpha(#7aa2f7, 0.5);
color: #c0caf5;
}

13
gtk-3.0/settings.ini Normal file
View File

@@ -0,0 +1,13 @@
[Settings]
# Static, not palette-templated - gsettings alone doesn't reach the GTK3 *widget theme*
# here because no XSETTINGS daemon (xsettingsd/gnome-settings-daemon/xfsettingsd) runs
# under Hyprland, so GtkSettings never picks up the dconf value hyprland.lua's
# config.reloaded hook sets for gtk-theme. This file is the direct, daemon-independent
# way to force it; gtk.css (see theme/templates/gtk3/) layers the actual palette colors
# on top of it. The *icon* theme is different: GTK resolves that straight from gsettings
# regardless of any XSETTINGS daemon, so it's set via `gsettings set ... icon-theme` in
# hyprland.lua instead - listing it here too would just be redundant, not more reliable.
gtk-theme-name=Materia-dark
gtk-application-prefer-dark-theme=1
gtk-cursor-theme-name=ArchLogo
gtk-cursor-theme-size=24