feat: added zellij layouts: base & flake, set base as default layout

This commit is contained in:
ooks-io 2024-02-09 16:27:32 +13:00
parent c8e6eba1a6
commit 7014f2787c

View file

@ -11,7 +11,7 @@ in
enable = true;
settings = {
theme = "${colorscheme.slug}";
default_layout = "compact";
default_layout = "base";
pane_frames = false;
themes = {
"${colorscheme.slug}" = {
@ -30,30 +30,40 @@ in
};
};
};
xdg.configFile."zellij/layouts/zjstatus.kld".text = /* kdl */ ''
xdg.configFile."zellij/layouts/base.kdl".text = /* kdl */ ''
layout {
pane split_direction="vertical" {
pane
}
pane size=1 borderless=true {
default_tab_template {
pane size=2 borderless=true {
plugin location="file:${pkgs.zjstatus}/bin/zjstatus.wasm" {
format_left "{mode} #[fg=#89B4FA,bold]{session} {tabs}"
format_right "{command_git_branch} {datetime}"
format_left "{mode} #[fg=#89B4FA,bold] {tabs}"
format_right "{session} {command_git_branch} {datetime}"
format_space ""
border_enabled "false"
border_enabled "true"
border_char ""
border_format "#[fg=#6C7086]{char}"
border_position "top"
border_format "#[fg=blue]{char}"
border_position "bottom"
hide_frame_for_single_pane "true"
mode_normal "#[bg=blue] "
mode_tmux "#[bg=#ffc387] "
mode_normal "#[fg=blue] "
mode_tmux "#[fg=purple] "
mode_pane "#[fg=red] "
mode_tab "#[fg=red] "
mode_rename_tab "#[fg=red] "
mode_rename_pane "#[fg=red] "
mode_session "#[fg=red] "
mode_locked "#[fg=white] "
mode_move "#[fg=green] "
mode_resize "#[fg=green] "
mode_prompt "#[fg=yellow] "
mode_search "#[fg=yellow] "
mode_enter_search "#[fg=yellow] "
tab_normal "#[fg=#6C7086] {name} "
tab_active "#[fg=#9399B2,bold,italic] {name} "
tab_normal "#[bg=#3C3836] {name} "
tab_active "#[bg=#504945] {name} "
tab_separator " "
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
command_git_branch_format "#[fg=blue] {stdout} "
@ -61,12 +71,81 @@ in
command_git_branch_rendermode "static"
datetime "#[fg=#6C7086,bold] {format} "
datetime_format "%A, %d %b %Y %H:%M"
datetime_format "%I:%M %p"
datetime_timezone "Pacific/Auckland"
}
}
children
}
tab name="terminal" focus=true {
pane name="term" cwd="~" focus=true
}
}
'';
xdg.configFile."zellij/layouts/flake.kdl".text = /* kdl */ ''
layout {
default_tab_template {
pane size=2 borderless=true {
plugin location="file:/nix/store/af53c2bwldpmpzrb01jy1xn779bhya09-zjstatus-0.12.0/bin/zjstatus.wasm" {
format_left "{mode} #[fg=#89B4FA,bold] {tabs}"
format_right "{session} {command_git_branch} {datetime}"
format_space ""
border_enabled "true"
border_char ""
border_format "#[fg=blue]{char}"
border_position "bottom"
hide_frame_for_single_pane "true"
mode_normal "#[fg=blue] "
mode_tmux "#[fg=purple] "
mode_pane "#[fg=red] "
mode_tab "#[fg=red] "
mode_rename_tab "#[fg=red] "
mode_rename_pane "#[fg=red] "
mode_session "#[fg=red] "
mode_locked "#[fg=white] "
mode_move "#[fg=green] "
mode_resize "#[fg=green] "
mode_prompt "#[fg=yellow] "
mode_search "#[fg=yellow] "
mode_enter_search "#[fg=yellow] "
tab_normal "#[bg=#3C3836] {name} "
tab_active "#[bg=#504945] {name} "
tab_separator " "
command_git_branch_command "git rev-parse --abbrev-ref HEAD"
command_git_branch_format "#[fg=blue] {stdout} "
command_git_branch_interval "10"
command_git_branch_rendermode "static"
datetime "#[fg=#6C7086,bold] {format} "
datetime_format "%I:%M %p"
datetime_timezone "Pacific/Auckland"
}
}
children
}
tab name="terminal" focus=true {
pane name="term" cwd="$FLAKE" focus=true
}
tab name="editor" {
pane name="edit" edit="$FLAKE"
}
tab name="git" {
pane name="git" cwd="$FLAKE" command="lazygit"
}
}
'';
home.shellAliases = {
zjf = "zellij --layout flake";
};
};
}