From db469ad58f02e43cad303c422fc3bd8f55522730 Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Mon, 17 Mar 2025 00:41:24 +1100 Subject: [PATCH] user/rofi-wayland: use catppuccin colours --- modules/user/rofi-wayland.nix | 19 +++++++++++++++++-- res/theme.rasi | 11 ++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/modules/user/rofi-wayland.nix b/modules/user/rofi-wayland.nix index 6bb85a0..19e569e 100644 --- a/modules/user/rofi-wayland.nix +++ b/modules/user/rofi-wayland.nix @@ -1,8 +1,23 @@ -{ config, pkgs, ... }: { +{ config, pkgs, ... }: +let + theme = pkgs.stdenvNoCC.mkDerivation { + pname = "rofi-theme"; + version = "1.0.0"; + dontUnpack = true; + installPhase = '' + cp ${../../res/theme.rasi} $out + substituteInPlace $out \ + --replace-fail "CAT_BACKGROUND" "${config.catppuccin.hexcolors.crust}" \ + --replace-fail "CAT_TEXT" "${config.catppuccin.hexcolors.text}" \ + --replace-fail "CAT_ACCENT" "${config.catppuccin.hexcolors.${config.catppuccin.accent}}" \ + --replace-fail "CAT_PLACEHOLDER" "${config.catppuccin.hexcolors.overlay1}" + ''; + }; +in { programs.rofi = { enable = true; package = pkgs.rofi-wayland; theme = "theme"; }; - xdg.configFile."rofi/theme.rasi".source = ../../res/theme.rasi; + xdg.configFile."rofi/theme.rasi".source = theme; } diff --git a/res/theme.rasi b/res/theme.rasi index fbf45e4..b7fd398 100644 --- a/res/theme.rasi +++ b/res/theme.rasi @@ -12,9 +12,9 @@ configuration { @theme "/dev/null" * { - bg: #12131b; - fg: #f3f6ff; - button: #ae58c8; + bg: CAT_BACKGROUND; + fg: CAT_TEXT; + button: CAT_ACCENT; background-color: @bg; text-color: @fg; @@ -30,7 +30,7 @@ prompt { enabled: false; } entry { placeholder: "Search"; - placeholder-color: #f3f6ff90; + placeholder-color: CAT_PLACEHOLDER; transparency: "real"; expand: true; font: "Noto Sans 32"; @@ -70,7 +70,7 @@ element-text { margin: 0% 3% 0.5% 3%; background-color: inherit; text-color: inherit; - font: "Noto Sans 12"; + font: "Noto Sans Medium 12"; } element-icon { @@ -85,4 +85,5 @@ element-icon { element selected { background-color: @button; border-radius: 8px; + text-color: @bg; }