zellij: write theme file instead of writing theme into config (#616)

Write theme file instead of writing theme into config.

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

[1]: https://github.com/danth/stylix/issues/486

Closes: https://github.com/danth/stylix/issues/486

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Kamron Bhavnagri 2024-11-14 20:48:15 +11:00 committed by GitHub
parent f361071a1b
commit e0a278871b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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}";
}
}
'';
};
}