From 3873de6003d1bdf924011a15da9c776b2a11ef54 Mon Sep 17 00:00:00 2001 From: ediblerope Date: Mon, 13 Apr 2026 21:20:41 +0100 Subject: [PATCH] Add GNOME Shell theme and User Themes extension Generates a custom GNOME Shell CSS for the top bar, quick settings, and notifications using wallpaper palette colors. Uses the User Themes extension to load it. Co-Authored-By: Claude Opus 4.6 --- home-manager/fred.nix | 4 ++++ settings/gnome.nix | 6 ++++++ templates/gnome-shell.css | 36 ++++++++++++++++++++++++++++++++++++ templates/recolor-folders.sh | 5 +++++ 4 files changed, 51 insertions(+) create mode 100644 templates/gnome-shell.css diff --git a/home-manager/fred.nix b/home-manager/fred.nix index bc10cee..f1eab1a 100644 --- a/home-manager/fred.nix +++ b/home-manager/fred.nix @@ -48,6 +48,10 @@ input_path = "${inputs.self}/templates/gtk4-colors.css" output_path = "${config.home.homeDirectory}/.config/gtk-4.0/colors.css" + [templates.gnome-shell] + input_path = "${inputs.self}/templates/gnome-shell.css" + output_path = "${config.home.homeDirectory}/.local/share/matugen/gnome-shell.css" + [templates.zen] input_path = "${inputs.self}/templates/zen-userChrome.css" output_path = "${config.home.homeDirectory}/.zen/fraudek5.Default Profile/chrome/userChrome.css" diff --git a/settings/gnome.nix b/settings/gnome.nix index bc127be..d373db3 100644 --- a/settings/gnome.nix +++ b/settings/gnome.nix @@ -18,6 +18,7 @@ gnomeExtensions.just-perfection gnomeExtensions.appindicator gnomeExtensions.hot-edge + gnomeExtensions.user-themes #gnomeExtensions.rounded-window-corners-reborn adwaita-icon-theme gnome-themes-extra @@ -157,6 +158,11 @@ "org/gnome/shell/extensions/just-perfection" = { window-demands-attention-focus = true; }; + + # User themes extension — load wallpaper shell theme + "org/gnome/shell/extensions/user-theme" = { + name = "WallpaperShell"; + }; }; }; }; diff --git a/templates/gnome-shell.css b/templates/gnome-shell.css new file mode 100644 index 0000000..59cc336 --- /dev/null +++ b/templates/gnome-shell.css @@ -0,0 +1,36 @@ +/* Wallpaper-based GNOME Shell colors generated by matugen */ +#panel { + background-color: {{colors.surface_container.default.hex}}; + color: {{colors.on_surface.default.hex}}; +} + +#panel .panel-button { + color: {{colors.on_surface.default.hex}}; +} + +.quick-settings { + background-color: {{colors.surface_container.default.hex}}; +} + +.quick-settings-grid .quick-toggle { + background-color: {{colors.surface_container_high.default.hex}}; + color: {{colors.on_surface.default.hex}}; +} + +.quick-settings-grid .quick-toggle:checked { + background-color: {{colors.primary_container.default.hex}}; + color: {{colors.on_primary_container.default.hex}}; +} + +.quick-settings .icon-button, .quick-settings .button { + color: {{colors.on_surface.default.hex}}; +} + +.popup-menu-content { + background-color: {{colors.surface_container.default.hex}}; +} + +.notification-banner { + background-color: {{colors.surface_container_high.default.hex}}; + color: {{colors.on_surface.default.hex}}; +} diff --git a/templates/recolor-folders.sh b/templates/recolor-folders.sh index a64048f..952f924 100644 --- a/templates/recolor-folders.sh +++ b/templates/recolor-folders.sh @@ -88,6 +88,11 @@ done # Update icon cache gtk-update-icon-cache -f "$ICON_DIR" 2>/dev/null || true +# Install GNOME Shell theme +SHELL_THEME="$HOME/.local/share/themes/WallpaperShell/gnome-shell" +mkdir -p "$SHELL_THEME" +cp "$HOME/.local/share/matugen/gnome-shell.css" "$SHELL_THEME/gnome-shell.css" 2>/dev/null + # Map wallpaper palette to closest GNOME accent color # Primary color RGB: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}} R={{colors.primary.default.red}}