From 1e1b8614b32ea2b60eb07a5c65350561b9dff569 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Fri, 28 Oct 2022 16:12:00 +0300 Subject: [PATCH] users/alacritty: add catppuccin theme --- themes/catppuccin/frappe.nix | 39 +++++++++++++++ themes/default.nix | 43 +++++++++++++++- users/modules/terminal.nix | 96 ++++++++++++++++++++++++++++++++++++ 3 files changed, 176 insertions(+), 2 deletions(-) diff --git a/themes/catppuccin/frappe.nix b/themes/catppuccin/frappe.nix index 00ee0fd..3cf5130 100644 --- a/themes/catppuccin/frappe.nix +++ b/themes/catppuccin/frappe.nix @@ -47,6 +47,45 @@ in window = { activeBorder = lavender; inactiveBorder = overlay0; + background = base; + mainText = text; + cursorText = base; + cursor = rosewater; + cursorVi = lavender; + searchText = base; + search = subtext0; + searchFocused = green; + footerText = base; + footer = subtext0; + hintsText = base; + hintsStart = yellow; + hintsEnd = subtext0; + selectionText = base; + selection = rosewater; + regular = { + color0 = surface1; + color1 = red; + color2 = green; + color3 = yellow; + color4 = blue; + color5 = pink; + color6 = teal; + color7 = subtext1; + }; + bold = { + color8 = surface2; + color9 = red; + color10 = green; + color11 = yellow; + color12 = blue; + color13 = pink; + color14 = teal; + color15 = subtext0; + }; + extended = { + color16 = peach; + color17 = rosewater; + }; }; notification = { background = mantle; diff --git a/themes/default.nix b/themes/default.nix index 7097b8b..8305e3d 100644 --- a/themes/default.nix +++ b/themes/default.nix @@ -14,8 +14,47 @@ in inactiveText = mkColorOption "Inactive text color"; }; window = { - activeBorder = mkColorOption "Color for window active border"; - inactiveBorder = mkColorOption "Color for window inactive border"; + activeBorder = mkColorOption "Window active border color"; + inactiveBorder = mkColorOption "Window inactive border color"; + background = mkColorOption "Terminal background color"; + mainText = mkColorOption "Terminal main text color"; + cursorText = mkColorOption "Cursor text color"; + cursor = mkColorOption "Cursor background color"; + cursorVi = mkColorOption "Cursor Vi Mode background color"; + searchText = mkColorOption "Search text color"; + search = mkColorOption "Search match background"; + searchFocused = mkColorOption "Search focused match background"; + footerText = mkColorOption "Footer bar text color"; + footer = mkColorOption "Footer bar background color"; + hintsText = mkColorOption "Keyboard regex hints text color"; + hintsStart = mkColorOption "Keyboard regex hints start background color"; + hintsEnd = mkColorOption "Keyboard regex hints end background color"; + selectionText = mkColorOption "Selection text color"; + selection = mkColorOption "Selection background color"; + regular = { + color0 = mkColorOption null; + color1 = mkColorOption null; + color2 = mkColorOption null; + color3 = mkColorOption null; + color4 = mkColorOption null; + color5 = mkColorOption null; + color6 = mkColorOption null; + color7 = mkColorOption null; + }; + bold = { + color8 = mkColorOption null; + color9 = mkColorOption null; + color10 = mkColorOption null; + color11 = mkColorOption null; + color12 = mkColorOption null; + color13 = mkColorOption null; + color14 = mkColorOption null; + color15 = mkColorOption null; + }; + extended = { + color16 = mkColorOption null; + color17 = mkColorOption null; + }; }; notification = { background = mkColorOption "Notification background color"; diff --git a/users/modules/terminal.nix b/users/modules/terminal.nix index 9199650..ddfa379 100644 --- a/users/modules/terminal.nix +++ b/users/modules/terminal.nix @@ -2,6 +2,7 @@ let cfg = config.local.alacritty; + themeCfg = config.local.theme; in { options.local.alacritty = with lib; { @@ -40,6 +41,101 @@ in size = cfg.fontSize; }; + + colors = { + primary = { + background = themeCfg.window.background; + foreground = themeCfg.window.mainText; + + dim_foreground = themeCfg.window.mainText; + bright_foreground = themeCfg.window.mainText; + }; + + cursor = { + text = themeCfg.window.cursorText; + cursor = themeCfg.window.cursor; + }; + + vi_mode_cursor = { + text = themeCfg.window.cursorText; + cursor = themeCfg.window.cursorVi; + }; + + search = { + matches = { + foreground = themeCfg.window.searchText; + background = themeCfg.window.search; + }; + focused_match = { + foreground = themeCfg.window.searchText; + background = themeCfg.window.searchFocused; + }; + footer_bar = { + foreground = themeCfg.window.footerText; + background = themeCfg.window.footer; + }; + }; + + hints = { + start = { + foreground = themeCfg.window.hintsText; + background = themeCfg.window.hintsStart; + }; + end = { + foreground = themeCfg.window.hintsText; + background = themeCfg.window.hintsEnd; + }; + }; + + selection = { + text = themeCfg.window.selectionText; + background = themeCfg.window.selection; + }; + + normal = { + black = themeCfg.window.regular.color0; + red = themeCfg.window.regular.color1; + green = themeCfg.window.regular.color2; + yellow = themeCfg.window.regular.color3; + blue = themeCfg.window.regular.color4; + magenta = themeCfg.window.regular.color5; + cyan = themeCfg.window.regular.color6; + white = themeCfg.window.regular.color7; + }; + + bright = { + black = themeCfg.window.bold.color8; + red = themeCfg.window.bold.color9; + green = themeCfg.window.bold.color10; + yellow = themeCfg.window.bold.color11; + blue = themeCfg.window.bold.color12; + magenta = themeCfg.window.bold.color13; + cyan = themeCfg.window.bold.color14; + white = themeCfg.window.bold.color15; + }; + + dim = { + black = themeCfg.window.regular.color0; + red = themeCfg.window.regular.color1; + green = themeCfg.window.regular.color2; + yellow = themeCfg.window.regular.color3; + blue = themeCfg.window.regular.color4; + magenta = themeCfg.window.regular.color5; + cyan = themeCfg.window.regular.color6; + white = themeCfg.window.regular.color7; + }; + + indexed_colors = [ + { + index = 16; + color = themeCfg.window.extended.color16; + } + { + index = 17; + color = themeCfg.window.extended.color17; + } + ]; + }; }; }; };