From f97054c804cd886b520148bb6f1df56b993c9fe9 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Sat, 13 Jun 2026 16:12:19 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20icon=20themes=20=E2=80=94=20Papirus,=20?= =?UTF-8?q?resolved=20from=20the=20JSON,=20for=20GTK=20+=20rofi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ships papirus-icon-theme and resolves an icon-theme name once in theme.nix → nomarchy.theme.iconTheme: the JSON's optional `icons` field, else Papirus-Dark/Light picked by `mode`. That single value feeds: - Stylix `stylix.icons` → gtk.iconTheme (Thunar and GTK apps) - rofi `show-icons` + `icon-theme` (the launcher now shows app icons) A preset or theme-state.json can set `icons` to any theme in the icon package to override per theme. Verified: flake check green; iconTheme resolves Papirus-Dark for tokyo-night and Papirus-Light for summer-day; gtk.enable true with gtk.iconTheme.name set; papirus in home.packages and the live ISO closure; rofi config.rasi carries icon-theme + show-icons:true. The rendered icons need a real session to see. Co-Authored-By: Claude Fable 5 --- README.md | 14 +++++++------- modules/home/rofi.nix | 3 ++- modules/home/stylix.nix | 11 +++++++++++ modules/home/theme.nix | 15 ++++++++++++++- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3a93cb5..198e40d 100644 --- a/README.md +++ b/README.md @@ -280,8 +280,8 @@ close · `SUPER+1..9` workspaces · `Print` region screenshot. follow-ups (claude-code in nixpkgs is unfree — allowUnfree is on) - planned binds: `SUPER+Space` → `rofi -dmenu`/quick-launch and `SUPER+M` → `nomarchy-menu` (main menu); `SUPER+D` stays `-show drun` - - launcher icons: `show-icons` is off until the icon-theme item below - lands (rofi needs an installed icon theme to show app icons) + - launcher icons: ✓ `show-icons` on, drawing from the theme's icon set + (Papirus, via the icon-themes work below) - decision record: resolves the old Walker/Lua question — no GTK4 launcher, no second theming pipeline; the dispatcher owns the menu structure, so the renderer stays swappable (we moved fuzzel → rofi 2.0 @@ -317,11 +317,11 @@ close · `SUPER+1..9` workspaces · `Print` region screenshot. via a synchronous tag, so a multi-minute switch never reads as a failed selection. (An honest indeterminate indicator — HM gives no % — a literal progress widget would be cosmetic; revisit only if wanted.) -- **Icon themes:** add `icon` to `theme-state.json`, have Stylix/GTK and - rofi (`show-icons`) consume it, and ensure the chosen icon theme is - pulled into the closure per active theme (a dark/light pair, e.g. - Papirus-Dark/Light, picked to match `mode`). Unblocks rofi launcher - icons and tidies Thunar/GTK app icons. +- **Icon themes:** ✓ ships `papirus-icon-theme`; the resolved name lives on + `nomarchy.theme.iconTheme` (the JSON's optional `icons` field, else + Papirus-Dark/Light by `mode`) and feeds both Stylix's `gtk.iconTheme` + (Thunar/GTK apps) and rofi's `show-icons`. Remaining (optional): per-theme + `icons` overrides for the presets, or shipping more icon packs. - **Nicer shell out of the box:** ship and default-configure a prompt (starship, themed from the JSON) plus modern-CLI ergonomics — `bat`→cat, `eza`→ls, `ripgrep`→grep, `fd`→find, `zoxide`→cd — wired as diff --git a/modules/home/rofi.nix b/modules/home/rofi.nix index 25e598b..4048940 100644 --- a/modules/home/rofi.nix +++ b/modules/home/rofi.nix @@ -131,7 +131,8 @@ in extraConfig = { modi = "drun,run"; - show-icons = false; # no icon theme shipped yet — clean text list + show-icons = true; # app icons via the theme's icon set + icon-theme = t.iconTheme; # resolved in theme.nix (Papirus-*/per-theme) drun-display-format = "{name}"; display-drun = "apps"; display-run = "run"; diff --git a/modules/home/stylix.nix b/modules/home/stylix.nix index 0edb147..e9be5c1 100644 --- a/modules/home/stylix.nix +++ b/modules/home/stylix.nix @@ -55,6 +55,17 @@ in size = lib.mkDefault 24; }; + # GTK/file-manager/rofi icon theme, resolved from the JSON in + # theme.nix (per-theme `icons`, else Papirus-Dark/Light by mode). + # Stylix sets gtk.iconTheme from this; both dark/light point at the + # already-mode-resolved name. + icons = { + enable = true; + package = lib.mkDefault pkgs.papirus-icon-theme; + dark = t.iconTheme; + light = t.iconTheme; + }; + fonts = { monospace = { name = t.fonts.mono; diff --git a/modules/home/theme.nix b/modules/home/theme.nix index 0710fe8..72420f2 100644 --- a/modules/home/theme.nix +++ b/modules/home/theme.nix @@ -44,11 +44,24 @@ let blur = true; shadow = true; }; + # Icon theme name; "" means "pick by mode" (resolved below). A preset + # or the state file can name any theme in the shipped icon package. + icons = ""; }; + + parsed = lib.recursiveUpdate defaults themeState; + + # Resolve the icon theme once and expose it on nomarchy.theme so both + # the GTK side (stylix.nix) and rofi (rofi.nix) agree. The shipped + # package (papirus-icon-theme) carries the Dark/Light pair. + iconTheme = + if parsed.icons != "" then parsed.icons + else if parsed.mode == "light" then "Papirus-Light" + else "Papirus-Dark"; in { config = { - nomarchy.theme = lib.recursiveUpdate defaults themeState; + nomarchy.theme = parsed // { inherit iconTheme; }; nomarchy.lib = { # "#7aa2f7" -> "rgb(7aa2f7)" (Hyprland color syntax)