feat: fix kitty theme switching via auto.conf, add catppuccin mocha theme

This commit is contained in:
2026-03-04 22:21:12 +01:00
parent 3cc73f77bb
commit 0d2d04ede1
3 changed files with 102 additions and 53 deletions
+52 -45
View File
@@ -1,63 +1,55 @@
{ config, pkgs, ... }:
let
c = config.theme.colors;
colorConf = ''
background ${c.bg}
foreground ${c.fg}
selection_background ${c.bg2}
selection_foreground ${c.fg}
cursor ${c.fg}
cursor_text_color ${c.bg}
url_color ${c.blue_b}
color0 ${c.bg1}
color8 ${c.bg2}
color1 ${c.red}
color9 ${c.red_b}
color2 ${c.green}
color10 ${c.green_b}
color3 ${c.yellow}
color11 ${c.yellow_b}
color4 ${c.blue}
color12 ${c.blue_b}
color5 ${c.purple}
color13 ${c.purple_b}
color6 ${c.aqua}
color14 ${c.aqua_b}
color7 ${c.fg4}
color15 ${c.fg1}
'';
in
{
programs.kitty = {
enable = true;
package = pkgs.emptyDirectory;
font = {
name = "JetBrainsMono Nerd Font";
size = 12;
};
settings = {
shell = "zsh --login";
# Colors
background = c.bg;
foreground = c.fg;
selection_background = c.bg2;
selection_foreground = c.fg;
cursor = c.fg;
cursor_text_color = c.bg;
url_color = c.blue_b;
color0 = c.bg1; color8 = c.bg2;
color1 = c.red; color9 = c.red_b;
color2 = c.green; color10 = c.green_b;
color3 = c.yellow; color11 = c.yellow_b;
color4 = c.blue; color12 = c.blue_b;
color5 = c.purple; color13 = c.purple_b;
color6 = c.aqua; color14 = c.aqua_b;
color7 = c.fg4; color15 = c.fg1;
# Window
window_padding_width = 12;
background_opacity = "1.0";
shell = "zsh --login";
window_padding_width = 12;
background_opacity = "1.0";
hide_window_decorations = "yes";
# Cursor
cursor_shape = "block";
cursor_blink_interval = 1;
# Scrollback
scrollback_lines = 3000;
# Selection
copy_on_select = "yes";
strip_trailing_spaces = "smart";
# Tab bar
tab_bar_style = "powerline";
tab_bar_align = "left";
tab_bar_edge = "top";
# Shell integration
shell_integration = "enabled";
cursor_shape = "block";
cursor_blink_interval = 1;
scrollback_lines = 3000;
copy_on_select = "yes";
strip_trailing_spaces = "smart";
tab_bar_style = "powerline";
tab_bar_align = "left";
tab_bar_edge = "top";
shell_integration = "enabled";
};
keybindings = {
"ctrl+shift+n" = "new_window";
"ctrl+t" = "new_tab";
@@ -66,4 +58,19 @@ in
"ctrl+0" = "change_font_size all 0";
};
};
# Write theme colors into the auto conf files so they take effect
# regardless of OS dark/light mode setting
home.file.".config/kitty/dark-theme.auto.conf" = {
force = true;
text = colorConf;
};
home.file.".config/kitty/light-theme.auto.conf" = {
force = true;
text = colorConf;
};
home.file.".config/kitty/no-preference-theme.auto.conf" = {
force = true;
text = colorConf;
};
}