From 11eb849f4612965022cdb149146abb68f5ddda13 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 26 Jul 2025 07:16:36 -0700 Subject: add themes in toml format for alacritty It's easier to just drop the themes in toml format in the alacritty directory and link them instead of trying to constantly convert them into the nix configuration. Switch the theme to catppuccin-latte (dark) theme for now. Add window decoration back. --- users/profiles/mac.nix | 2 +- users/programs/alacritty.nix | 90 -------------------------- users/programs/alacritty/catppuccin-latte.toml | 65 +++++++++++++++++++ users/programs/alacritty/default.nix | 54 ++++++++++++++++ 4 files changed, 120 insertions(+), 91 deletions(-) delete mode 100644 users/programs/alacritty.nix create mode 100644 users/programs/alacritty/catppuccin-latte.toml create mode 100644 users/programs/alacritty/default.nix diff --git a/users/profiles/mac.nix b/users/profiles/mac.nix index b95474e..85b3e7c 100644 --- a/users/profiles/mac.nix +++ b/users/profiles/mac.nix @@ -10,7 +10,7 @@ ./secrets.nix ./ssh.nix ./starship.nix - "${self}/users/programs/alacritty.nix" + "${self}/users/programs/alacritty" "${self}/users/programs/bat.nix" ]; diff --git a/users/programs/alacritty.nix b/users/programs/alacritty.nix deleted file mode 100644 index 89356cd..0000000 --- a/users/programs/alacritty.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ ... }: -let - defaultFont = "Source Code Pro"; -in -{ - programs.alacritty = { - enable = true; - settings = { - selection.save_to_clipboard = true; - window = { - dimensions = { - columns = 120; - lines = 40; - }; - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. - padding = { - x = 2; - y = 2; - }; - # Spread additional padding evenly around the terminal content. - dynamic_padding = false; - decorations = "Buttonless"; - startup_mode = "Windowed"; - dynamic_title = true; - }; - scrolling = { - history = 10000; - multiplier = 3; - }; - font = { - normal.family = defaultFont; - bold = { - family = defaultFont; - style = "Bold"; - }; - italic = { - family = defaultFont; - style = "Italic"; - }; - size = 14; - offset = { - x = 0; - y = 0; - }; - glyph_offset = { - x = 0; - y = 0; - }; - }; - bell = { - animation = "EaseOutExpo"; - duration = 0; - color = "0xffffff"; - }; - colors = { - primary = { - background = "#FAFAFA"; - foreground = "#111111"; - }; - cursor = { - text = "#FAFAFA"; - cursor = "#111111"; - }; - normal = { - black = "#000000"; - red = "#AA3731"; - green = "#448C27"; - yellow = "#CB9000"; - blue = "#325CC0"; - magenta = "#7A3E9D"; - cyan = "#0083B2"; - white = "#BBBBBB"; - }; - bright = { - black = "#777777"; - red = "#F05050"; - green = "#60CB00"; - yellow = "#FFBC5D"; - blue = "#007ACC"; - magenta = "#E64CE6"; - cyan = "#00AACB"; - white = "#FFFFFF"; - }; - }; - }; - }; -} diff --git a/users/programs/alacritty/catppuccin-latte.toml b/users/programs/alacritty/catppuccin-latte.toml new file mode 100644 index 0000000..e9414ad --- /dev/null +++ b/users/programs/alacritty/catppuccin-latte.toml @@ -0,0 +1,65 @@ +[colors.primary] +background = "#eff1f5" +foreground = "#4c4f69" +dim_foreground = "#8c8fa1" +bright_foreground = "#4c4f69" + +[colors.cursor] +text = "#eff1f5" +cursor = "#dc8a78" + +[colors.vi_mode_cursor] +text = "#eff1f5" +cursor = "#7287fd" + +[colors.search.matches] +foreground = "#eff1f5" +background = "#6c6f85" + +[colors.search.focused_match] +foreground = "#eff1f5" +background = "#40a02b" + +[colors.footer_bar] +foreground = "#eff1f5" +background = "#6c6f85" + +[colors.hints.start] +foreground = "#eff1f5" +background = "#df8e1d" + +[colors.hints.end] +foreground = "#eff1f5" +background = "#6c6f85" + +[colors.selection] +text = "#eff1f5" +background = "#dc8a78" + +[colors.normal] +black = "#bcc0cc" +red = "#d20f39" +green = "#40a02b" +yellow = "#df8e1d" +blue = "#1e66f5" +magenta = "#ea76cb" +cyan = "#179299" +white = "#5c5f77" + +[colors.bright] +black = "#acb0be" +red = "#d20f39" +green = "#40a02b" +yellow = "#df8e1d" +blue = "#1e66f5" +magenta = "#ea76cb" +cyan = "#179299" +white = "#6c6f85" + +[[colors.indexed_colors]] +index = 16 +color = "#fe640b" + +[[colors.indexed_colors]] +index = 17 +color = "#dc8a78" diff --git a/users/programs/alacritty/default.nix b/users/programs/alacritty/default.nix new file mode 100644 index 0000000..8018af6 --- /dev/null +++ b/users/programs/alacritty/default.nix @@ -0,0 +1,54 @@ +{ config, ... }: +let + defaultFont = "Source Code Pro"; +in +{ + programs.alacritty = { + enable = true; + settings = { + env.TERM = "xterm-256color"; + general.import = [ + "${config.xdg.configHome}/alacritty/catppuccin-latte.toml" + ]; + selection.save_to_clipboard = true; + window = { + dimensions = { + columns = 120; + lines = 40; + }; + padding = { + x = 2; + y = 2; + }; + }; + scrolling = { + history = 10000; + multiplier = 3; + }; + font = { + normal.family = defaultFont; + bold = { + family = defaultFont; + style = "Bold"; + }; + italic = { + family = defaultFont; + style = "Italic"; + }; + size = 14; + offset = { + x = 0; + y = 0; + }; + glyph_offset = { + x = 0; + y = 0; + }; + }; + }; + }; + + home.file.".config/alacritty/catppuccin-late.toml" = { + source = ./catppuccin-latte.toml; + }; +} -- cgit v1.2.3