From 66b1642d7cb6373283ee821ded0eacc2316fd24b Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 7 Jan 2023 12:29:27 -0800 Subject: [PATCH] Improve colors, dynamically theme rofi --- colors/default.nix | 4 + {polybar => colors}/everforest-dark.nix | 0 {polybar => colors}/everforest-medium.nix | 0 {polybar => colors}/nord.nix | 0 hosts/thinkpads/polybar.nix | 2 +- polybar/colors.nix | 1 - polybar/default.nix | 2 +- rofi/default.nix | 6 +- rofi/nord.rasi | 142 ---------------------- rofi/theme.nix | 86 +++++++++++++ 10 files changed, 94 insertions(+), 149 deletions(-) create mode 100644 colors/default.nix rename {polybar => colors}/everforest-dark.nix (100%) rename {polybar => colors}/everforest-medium.nix (100%) rename {polybar => colors}/nord.nix (100%) delete mode 120000 polybar/colors.nix delete mode 100644 rofi/nord.rasi create mode 100644 rofi/theme.nix diff --git a/colors/default.nix b/colors/default.nix new file mode 100644 index 0000000..24fecd3 --- /dev/null +++ b/colors/default.nix @@ -0,0 +1,4 @@ +{ + undefined = "#ff00ff"; + foreground-bright = "#ffffff"; +} // import ./everforest-medium.nix diff --git a/polybar/everforest-dark.nix b/colors/everforest-dark.nix similarity index 100% rename from polybar/everforest-dark.nix rename to colors/everforest-dark.nix diff --git a/polybar/everforest-medium.nix b/colors/everforest-medium.nix similarity index 100% rename from polybar/everforest-medium.nix rename to colors/everforest-medium.nix diff --git a/polybar/nord.nix b/colors/nord.nix similarity index 100% rename from polybar/nord.nix rename to colors/nord.nix diff --git a/hosts/thinkpads/polybar.nix b/hosts/thinkpads/polybar.nix index 4c5b799..4b30e34 100644 --- a/hosts/thinkpads/polybar.nix +++ b/hosts/thinkpads/polybar.nix @@ -1,7 +1,7 @@ { pkgs, lib, ... }: let - colors = import ../../polybar/colors.nix; + colors = import ../../colors; in { home.packages = with pkgs; [ lm_sensors ]; diff --git a/polybar/colors.nix b/polybar/colors.nix deleted file mode 120000 index d99fa72..0000000 --- a/polybar/colors.nix +++ /dev/null @@ -1 +0,0 @@ -everforest-medium.nix \ No newline at end of file diff --git a/polybar/default.nix b/polybar/default.nix index e26c6a2..999197d 100644 --- a/polybar/default.nix +++ b/polybar/default.nix @@ -1,7 +1,7 @@ { pkgs, lib, ... }: let - colors = import ./colors.nix; + colors = import ../colors; in { # Dependencies diff --git a/rofi/default.nix b/rofi/default.nix index 665b551..4ff19b8 100644 --- a/rofi/default.nix +++ b/rofi/default.nix @@ -7,9 +7,7 @@ ]; programs.rofi = { enable = true; - theme = "nord"; - }; - home.file.".config/rofi/nord.rasi" = { - source = ./nord.rasi; + theme = "theme"; }; + home.file.".config/rofi/theme.rasi".text = import ./theme.nix; } diff --git a/rofi/nord.rasi b/rofi/nord.rasi deleted file mode 100644 index 5e6972a..0000000 --- a/rofi/nord.rasi +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Nordic rofi theme - * Adapted by undiabler - * - * Nord Color palette imported from https://www.nordtheme.com/ - * - */ - -configuration { - - font: "Noto Sans Mono 12"; - width: 30; - line-margin: 10; - lines: 6; - columns: 2; - - display-ssh: ""; - display-run: ""; - display-drun: ""; - display-window: ""; - display-combi: ""; - show-icons: true; -} - -* { - nord0: #2e3440; - nord1: #3b4252; - nord2: #434c5e; - nord3: #4c566a; - - nord4: #d8dee9; - nord5: #e5e9f0; - nord6: #eceff4; - - nord7: #8fbcbb; - nord8: #88c0d0; - nord9: #81a1c1; - nord10: #5e81ac; - nord11: #bf616a; - - nord12: #d08770; - nord13: #ebcb8b; - nord14: #a3be8c; - nord15: #b48ead; - - foreground: @nord9; - backlight: #ccffeedd; - background-color: transparent; - - highlight: underline bold #eceff4; - - transparent: rgba(46,52,64,0); -} - -window { - location: center; - anchor: center; - transparency: "screenshot"; - padding: 0px; - border: 0px; - border-radius: 0px; - - background-color: @transparent; - spacing: 0; - children: [mainbox]; - orientation: horizontal; -} - -mainbox { - spacing: 0; - children: [ inputbar, message, listview ]; -} - -message { - color: @nord0; - padding: 5; - border-color: @foreground; - border: 0px 2px 2px 2px; - background-color: @nord7; -} - -inputbar { - color: @nord6; - padding: 11px; - background-color: #3b4252; - - border: 0px; - border-radius: 6px 6px 0px 0px; - border-color: @nord10; -} - -entry, prompt, case-indicator { - text-font: inherit; - text-color:inherit; -} - -prompt { - margin: 0px 0.3em 0em 0em ; -} - -listview { - padding: 8px; - border-radius: 0px 0px 6px 6px; - border-color: @nord10; - border: 0; - background-color: rgba(46,52,64,0.9); - dynamic: false; -} - -element { - padding: 3px; - vertical-align: 0.5; - border-radius: 4px; - background-color: transparent; - color: @foreground; - text-color: rgb(216, 222, 233); -} - -element selected.normal { - background-color: @nord7; - text-color: #2e3440; -} - -element-text, element-icon { - background-color: inherit; - text-color: inherit; -} - -button { - padding: 6px; - color: @foreground; - horizontal-align: 0.5; - - border: 2px 0px 2px 2px; - border-radius: 4px 0px 0px 4px; - border-color: @foreground; -} - -button selected normal { - border: 2px 0px 2px 2px; - border-color: @foreground; -} diff --git a/rofi/theme.nix b/rofi/theme.nix new file mode 100644 index 0000000..5389da9 --- /dev/null +++ b/rofi/theme.nix @@ -0,0 +1,86 @@ +# Modified from https://github.com/undiabler/nord-rofi-theme +let colors = import ../colors; in +'' +configuration { + font: "Noto Sans Mono 12"; + width: 30; + line-margin: 10; + lines: 6; + columns: 2; + + display-ssh: ""; + display-run: ""; + display-drun: ""; + display-window: ""; + display-combi: ""; + show-icons: true; +} + +* { + background-color: transparent; + highlight: underline bold ${colors.foreground-bright}; +} + +window { + location: center; + anchor: center; + transparency: "screenshot"; + padding: 0px; + border: 0px; + border-radius: 0px; + + spacing: 0; + children: [mainbox]; + orientation: horizontal; +} + +mainbox { + spacing: 0; + children: [ inputbar, message, listview ]; +} + +message { + color: ${colors.background}; + padding: 5; + border-color: ${colors.foreground}; + border: 0px 2px 2px 2px; +} + +inputbar { + color: ${colors.foreground}; + padding: 11px; + background-color: ${colors.background-alt}; +} + +entry, prompt, case-indicator { + text-font: inherit; + text-color: inherit; +} + +prompt { + margin: 0px 0.3em 0em 0em; +} + +listview { + padding: 8px; + border: 0; + background-color: ${colors.background}e5; + dynamic: false; +} + +element { + padding: 3px; + border-radius: 4px; + text-color: ${colors.foreground}; +} + +element selected.normal { + background-color: ${colors.primary}; + text-color: ${colors.background}; +} + +element-text, element-icon { + background-color: inherit; + text-color: inherit; +} +''