Skip to content

Commit

Permalink
zellij: write theme file instead of writing theme into config (#616)
Browse files Browse the repository at this point in the history
Write theme file instead of writing theme into config.

Also, fix contrast issues [1] by changing the red color to base01.

[1]: #486

Closes: #486

Reviewed-by: NAHO <[email protected]>
  • Loading branch information
KamWithK authored Nov 14, 2024
1 parent f361071 commit e0a2788
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions modules/zellij/hm.nix
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{ config, lib, ... }:

{
options.stylix.targets.zellij.enable =
config.lib.stylix.mkEnableTarget "zellij" true;
options.stylix.targets.zellij.enable = config.lib.stylix.mkEnableTarget "zellij" true;

config = lib.mkIf (config.stylix.enable && config.stylix.targets.zellij.enable) {
programs.zellij.settings = {
theme = "stylix";
themes.stylix = with config.lib.stylix.colors.withHashtag; {
bg = base03;
fg = base05;
red = base08;
green = base0B;
blue = base0D;
yellow = base0A;
magenta = base0E;
orange = base09;
cyan = base0C;
black = base00;
white = base07;
};
};
};
config =
lib.mkIf
(config.stylix.enable && config.stylix.targets.zellij.enable && config.programs.zellij.enable)
{
xdg.configFile."zellij/themes/stylix.kdl".text = with config.lib.stylix.colors.withHashtag; ''
themes {
default {
bg "${base03}";
fg "${base05}";
red "${base01}";
green "${base0B}";
blue "${base0D}";
yellow "${base0A}";
magenta "${base0E}";
orange "${base09}";
cyan "${base0C}";
black "${base00}";
white "${base07}";
}
}
'';
};

}

0 comments on commit e0a2788

Please sign in to comment.