Rename layout file, allow for layout to be specified by envar

This commit is contained in:
Daniel Lynn 2023-03-24 15:45:42 -05:00
parent a1dd3a635a
commit baf106d5c9
Signed by: daniel
GPG Key ID: 655C07B9B3DDC88B
2 changed files with 3 additions and 90 deletions

View File

@ -1,87 +0,0 @@
layout {
pane_template name="explorer" {
pane split_direction="vertical" {
pane size="14%" borderless=true command="exa" {
args "--color=always" "--icons" "--git" "--tree" "-L2"
}
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="ide-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" {
ide-tab max_panes=3 {
explorer { pane; }
}
ide-tab exact_panes=4 {
explorer { pane; }
console-pane split_direction="vertical" size="28%" { pane; }
}
ide-tab exact_panes=5 {
explorer { pane; }
console-pane split_direction="vertical" size="28%" {
pane
pane
}
}
ide-tab exact_panes=6 {
explorer { pane; }
stacked-console-pane stacked=true size="28%" {
pane
pane
pane
}
}
ide-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
}
}
ide-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
}
}
}
}
}

6
zshrc
View File

@ -107,9 +107,9 @@ if (( $+commands[zellij] )); then
eval "$(zellij setup --generate-auto-start zsh)"
ide() {
local layout="${HOME}/.config/zellij/layouts/ide.kdl"
local name=${PWD##*/}
local name=${name:-/}
local layout="${ZELLIJ_LAYOUT:-${HOME}/.config/zellij/layouts/project.kdl}"
local name="${PWD##*/}"
local name="${name:-/}"
if (( ${+ZELLIJ} )); then
zellij action new-tab --layout "${layout}" --cwd "${PWD}" --name "${name}"