{
config,
inputs,
lib,
pkgs,
...
}: let
cfg = config.roles.zellij;
# Hard light:
# https://github.com/sainnhe/everforest/blob/master/palette.md#light
# https://github.com/sainnhe/everforest/blob/e5b9e2fb676a9ded3e86ae51924f7962fa4fb0ac/autoload/everforest.vim#L51
everforest = {
bg0 = "#FFF9E8";
bg1 = "#F8F5E4";
bg2 = "#F2EFDF";
bg3 = "#EDEADA";
bg4 = "#E8E5D5";
bg5 = "#BEC5B2";
fg = {
default = "#5C6A72";
accent = {
cyan = "#35A77C";
green = "#8DA101";
};
grey0 = "#7A8478";
grey1 = "#859289";
grey2 = "#9DA9A0";
statusline = {
green = "#93B259";
grey = "#708089";
red = "#E66868";
};
};
};
zjstatus = ''
plugin location="file:${inputs.zjstatus.packages.${pkgs.system}.default}/bin/zjstatus.wasm" {
format_left "{mode}"
format_center "{tabs}"
mode_locked "#[fg=${everforest.bg0},bg=${everforest.fg.statusline.red},bold] {name} "
mode_normal "#[fg=${everforest.bg0},bg=${everforest.fg.statusline.green},bold] {name} "
mode_tab "#[fg=${everforest.bg0},bg=${everforest.fg.accent.cyan},bold] {name} "
tab_active "#[fg=${everforest.bg0},bg=${everforest.fg.statusline.green}] {name} "
tab_normal "#[fg=${everforest.fg.default},bg=${everforest.bg3}] {name} "
}
'';
in {
options.roles.zellij = {
enable = lib.mkEnableOption "enable zellij";
};
config = lib.mkIf cfg.enable {
hm = {
programs.zellij = {
enable = true;
settings = {
default_shell = "elvish";
simplified_ui = true;
pane_frames = false;
default_layout = "default";
ui.pane_frames.hide_session_name = true;
};
};
home.file.".config/zellij/layouts/default.kdl".text = ''
layout {
default_tab_template {
children
pane size=1 {
${zjstatus}
}
}
tab {
pane
}
}
'';
home.file.".config/zellij/layouts/dev.kdl".text = ''
layout {
default_tab_template {
children
pane size=1 {
${zjstatus}
}
}
tab name="nvim" focus=true {
pane
}
tab name="shell" {
pane
}
}
keybinds {
locked {
bind "Insert" { GoToTab 2; SwitchToMode "Normal"; }
}
shared_except "locked" {
bind "Insert" { GoToTab 1; SwitchToMode "Locked"; }
}
}
'';
};
};
}