From cd0afe0797d086ddd87cc1dba5fde8445c699840 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 25 Jan 2023 17:47:51 -0800 Subject: [PATCH] Improve color system, rofi theme formatting system --- colors/default.nix | 10 +++++++--- colors/everforest/default.nix | 2 ++ colors/nord/default.nix | 2 ++ rofi/default.nix | 11 ++++++++--- rofi/{theme.nix => theme.rasi} | 23 ++++++++++------------- 5 files changed, 29 insertions(+), 19 deletions(-) rename rofi/{theme.nix => theme.rasi} (71%) diff --git a/colors/default.nix b/colors/default.nix index 7e8d926..d221312 100644 --- a/colors/default.nix +++ b/colors/default.nix @@ -1,8 +1,12 @@ let theme = import ./everforest; + colors = { + undefined = "#ff00ff"; + fg1 = "#ffffff"; + }; in { - undefined = "#ff00ff"; - fg1 = "#ffffff"; css = lib: lib.strings.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs (k: v: " --${k}: ${v};") theme.colors)); -} // theme // theme.colors +} +// colors // theme.colors # Root colors +// theme // { colors = theme.colors // colors; } # Dedicated color set diff --git a/colors/everforest/default.nix b/colors/everforest/default.nix index a5b4ce5..a7515a0 100644 --- a/colors/everforest/default.nix +++ b/colors/everforest/default.nix @@ -1,4 +1,6 @@ { + theme = "everforest"; + kitty-theme = "Everforest Dark Hard"; gtkTheme = pkgs: { package = pkgs.callPackage ./gtk.nix {}; diff --git a/colors/nord/default.nix b/colors/nord/default.nix index af7f861..e8e6f6e 100644 --- a/colors/nord/default.nix +++ b/colors/nord/default.nix @@ -1,4 +1,6 @@ { + theme = "nord"; + kitty-theme = "Nord"; wallpaper = "roxynord.png"; gtkTheme = pkgs: { diff --git a/rofi/default.nix b/rofi/default.nix index 4ff19b8..a1948be 100644 --- a/rofi/default.nix +++ b/rofi/default.nix @@ -1,13 +1,18 @@ { pkgs, ... }: -{ +let + colors = import ../colors; + theme = colors.theme; +in { home.packages = with pkgs; [ (pkgs.callPackage ./power.nix { }) wmctrl # TODO: add as dependency of rofi-power ]; programs.rofi = { enable = true; - theme = "theme"; + inherit theme; }; - home.file.".config/rofi/theme.rasi".text = import ./theme.nix; + home.file.".config/rofi/${theme}.rasi".source = pkgs.substituteAll ({ + src = ./theme.rasi; + } // colors.colors); } diff --git a/rofi/theme.nix b/rofi/theme.rasi similarity index 71% rename from rofi/theme.nix rename to rofi/theme.rasi index 3e04f6b..4b19e8e 100644 --- a/rofi/theme.nix +++ b/rofi/theme.rasi @@ -1,6 +1,4 @@ -# Modified from https://github.com/undiabler/nord-rofi-theme -let colors = import ../colors; in -'' +/* Modified from https://github.com/undiabler/nord-rofi-theme */ configuration { font: "Noto Sans Mono 12"; width: 30; @@ -18,7 +16,7 @@ configuration { * { background-color: transparent; - highlight: underline bold ${colors.fg1}; + highlight: underline bold @fg1@; } window { @@ -40,16 +38,16 @@ mainbox { } message { - color: ${colors.bg0}; + color: @bg0@; padding: 5; - border-color: ${colors.fg0}; + border-color: @fg0@; border: 0px 2px 2px 2px; } inputbar { - color: ${colors.fg0}; + color: @fg0@; padding: 11px; - background-color: ${colors.bg1}; + background-color: @bg1@; } entry, prompt, case-indicator { @@ -64,23 +62,22 @@ prompt { listview { padding: 8px; border: 0; - background-color: ${colors.bg0}e5; + background-color: @bg0@e5; dynamic: false; } element { padding: 3px; border-radius: 4px; - text-color: ${colors.fg0}; + text-color: @fg0@; } element selected.normal { - background-color: ${colors.primary}; - text-color: ${colors.bg0}; + background-color: @primary@; + text-color: @bg0@; } element-text, element-icon { background-color: inherit; text-color: inherit; } -''