From f906dd126c3543ff1e506d156bfc74b2295928ee Mon Sep 17 00:00:00 2001 From: Daniel Lynn Date: Wed, 16 Apr 2025 15:18:38 -0500 Subject: [PATCH] Remove custom zellij layouts; auto-rename new tabs to cwd --- zellij/layouts/project.kdl | 87 -------------------------------------- zsh.d/zellij.zsh | 15 ++++--- 2 files changed, 10 insertions(+), 92 deletions(-) delete mode 100644 zellij/layouts/project.kdl diff --git a/zellij/layouts/project.kdl b/zellij/layouts/project.kdl deleted file mode 100644 index c7461b7..0000000 --- a/zellij/layouts/project.kdl +++ /dev/null @@ -1,87 +0,0 @@ -layout { - pane_template name="explorer" { - pane split_direction="vertical" { - pane size="14%" borderless=true command="zsh" { - args "-i" "-c" "exex" - } - children - } - } - - pane_template name="sidebar-pane" { - pane size="24%" split_direction="horizontal" { children; } - } - - pane_template name="console-pane" { - pane size="28%" split_direction="vertical" { children; } - } - - pane_template name="stacked-console-pane" { - pane size="28%" stacked=true { children; } - } - - tab_template name="project-tab" { - pane size=1 borderless=true { plugin location="zellij:compact-bar"; } - children - } - - default_tab_template { - pane size=1 borderless=true { plugin location="zellij:compact-bar"; } - explorer { pane focus=true; } - } - - swap_tiled_layout name="ide" { - project-tab max_panes=3 { - explorer { pane; } - } - project-tab exact_panes=4 { - explorer { pane; } - console-pane split_direction="vertical" size="28%" { pane; } - } - project-tab exact_panes=5 { - explorer { pane; } - console-pane split_direction="vertical" size="28%" { - pane - pane - } - } - project-tab exact_panes=6 { - explorer { pane; } - stacked-console-pane stacked=true size="28%" { - pane - pane - pane - } - } - project-tab exact_panes=7 { - explorer split_direction="vertical" { - pane - sidebar-pane size="24%" { pane borderless=true; } - } - stacked-console-pane stacked=true size="28%" { - pane - pane - pane - } - } - project-tab min_panes=8 { - explorer { - pane split_direction="vertical" { - pane - pane - pane - } - pane split_direction="vertical" { - pane - pane - pane - } - pane split_direction="vertical" { - pane - pane - pane - } - } - } - } -} diff --git a/zsh.d/zellij.zsh b/zsh.d/zellij.zsh index 46031c4..d3d19f8 100644 --- a/zsh.d/zellij.zsh +++ b/zsh.d/zellij.zsh @@ -1,20 +1,25 @@ # zellij if (( $+commands[zellij] )); then - # Uncomment to start zellij automatically + # Uncomment to start/exit zellij automatically # ZELLIJ_AUTO_ATTACH=true + # ZELLIJ_AUTO_EXIT=true # eval "$(zellij setup --generate-auto-start zsh)" if (( $+commands[sk] )); then - za() { + function za { local zj_sessions=$(zellij list-sessions -ns) local no_sessions=$(echo "${zj_sessions}" | wc -l) if [ "${no_sessions}" -ge 2 ]; then - zellij attach \ - "$(echo "${zj_sessions}" | sk)" + zellij attach \ + "$(echo "${zj_sessions}" | sk)" else - zellij attach -c + zellij attach -c fi } fi + + if [[ -v ZELLIJ ]]; then + zellij action rename-tab "${PWD##*/}" + fi fi