From f8413fd424be064ffaa2fb21264ff18edc42afc3 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 22 Jun 2024 18:31:31 +0200 Subject: Switch to gruvbox and add ability to use light and dark mode --- alacritty/alacritty.toml | 35 +---------------------------------- alacritty/colors-dark.toml | 28 ++++++++++++++++++++++++++++ alacritty/colors-light.toml | 28 ++++++++++++++++++++++++++++ alacritty/default.nix | 21 ++++++++++++++++----- 4 files changed, 73 insertions(+), 39 deletions(-) create mode 100644 alacritty/colors-dark.toml create mode 100644 alacritty/colors-light.toml (limited to 'alacritty') diff --git a/alacritty/alacritty.toml b/alacritty/alacritty.toml index edef4a7..ea60335 100644 --- a/alacritty/alacritty.toml +++ b/alacritty/alacritty.toml @@ -1,6 +1,6 @@ # https://alacritty.org/config-alacritty.html -import = [ "$HINTS_FILE" ] +import = [ "$HINTS_FILE", "$COLORS_FILE" ] [window] decorations = "None" @@ -8,36 +8,3 @@ decorations = "None" [font] normal = { family = "Source Code Pro", style = "Normal" } size = 6.3 - -# Colors (PaperColor - Light) - -# Default colors -[colors.primary] -background = '#eeeeee' -foreground = '#444444' - -[colors.cursor] -text = '#eeeeee' -cursor = '#444444' - -# Normal colors -[colors.normal] -black = '#eeeeee' -red = '#af0000' -green = '#008700' -yellow = '#5f8700' -blue = '#0087af' -magenta = '#878787' -cyan = '#005f87' -white = '#444444' - -# Bright colors -[colors.bright] -black = '#bcbcbc' -red = '#d70000' -green = '#d70087' -yellow = '#8700af' -blue = '#d75f00' -magenta = '#d75f00' -cyan = '#005faf' -white = '#005f87' diff --git a/alacritty/colors-dark.toml b/alacritty/colors-dark.toml new file mode 100644 index 0000000..f9fb56d --- /dev/null +++ b/alacritty/colors-dark.toml @@ -0,0 +1,28 @@ +# Colors (Gruvbox Material Hard Dark) + +# Default colors +[colors.primary] +background = '#1d2021' +foreground = '#d4be98' + +# Normal colors +[colors.normal] +black = '#32302f' +red = '#ea6962' +green = '#a9b665' +yellow = '#d8a657' +blue = '#7daea3' +magenta = '#d3869b' +cyan = '#89b482' +white = '#d4be98' + +# Bright colors (same as normal colors) +[colors.bright] +black = '#32302f' +red = '#ea6962' +green = '#a9b665' +yellow = '#d8a657' +blue = '#7daea3' +magenta = '#d3869b' +cyan = '#89b482' +white = '#d4be98' diff --git a/alacritty/colors-light.toml b/alacritty/colors-light.toml new file mode 100644 index 0000000..e17ebdf --- /dev/null +++ b/alacritty/colors-light.toml @@ -0,0 +1,28 @@ +# Colors (Gruvbox Material Hard Light) + +# Default colors +[colors.primary] +background = '#f9f5d7' +foreground = '#654735' + +# Normal colors +[colors.normal] +black = '#654735' +red = '#c14a4a' +green = '#6c782e' +yellow = '#b47109' +blue = '#45707a' +magenta = '#945e80' +cyan = '#4c7a5d' +white = '#f2e5bc' + +# Bright colors (same as normal colors) +[colors.bright] +black = '#654735' +red = '#c14a4a' +green = '#6c782e' +yellow = '#b47109' +blue = '#45707a' +magenta = '#945e80' +cyan = '#4c7a5d' +white = '#f2e5bc' diff --git a/alacritty/default.nix b/alacritty/default.nix index 9350884..40d7074 100644 --- a/alacritty/default.nix +++ b/alacritty/default.nix @@ -43,10 +43,12 @@ hintsFile = (pkgs.formats.toml {}).generate "alacritty-hints.toml" hintsFileBody; - configFile = pkgs.writeText "alacritty-config" ( + configFile = { + colorsFile, + }: pkgs.writeText "alacritty-config" ( builtins.replaceStrings - ["$HINTS_FILE"] - ["${hintsFile}"] + ["$HINTS_FILE" "$COLORS_FILE"] + ["${hintsFile}" "${colorsFile}"] (builtins.readFile ./alacritty.toml) ); @@ -54,7 +56,10 @@ exec ${alacrittyUnwrap} "${zsh}/bin/zsh" "$@" ''; - alacritty = pkgs.writeShellScriptBin "alacritty" '' + mkAlacritty = { + name ? "alacritty", + colorsFile ? ./colors-dark.toml, + }: pkgs.writeShellScriptBin name '' set -e -x source "${pkgs.ldUtils}" @@ -82,7 +87,13 @@ exec ${pkgs.alacritty}/bin/alacritty \ -o font.size=${builtins.toString config.alacritty.fontSize} \ - --config-file ${configFile} \ + --config-file ${configFile { inherit colorsFile; }} \ -e "${shellEntrypoint}" ''; + + alacritty = mkAlacritty {}; + alacrittyLight = mkAlacritty { + name = "alacritty-light"; + colorsFile = ./colors-light.toml; + }; } -- cgit v1.2.3