diff --git a/_home/private_dot_config/sz.env/fix-kubectl.env b/_home/private_dot_config/sz.env/fix-kubectl.env index a71ada8..88adcd6 100644 --- a/_home/private_dot_config/sz.env/fix-kubectl.env +++ b/_home/private_dot_config/sz.env/fix-kubectl.env @@ -1,5 +1,7 @@ #!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"' -if is_cmd fix-kubectl; then - . <( fix-kubectl - ) +if is_cmd szetup-kubectl4k3s && [ "$(systemctl is-active k3s.service)" = "active" ]; then + . <( szetup-kubectl4k3s - ) + + [[ -n "${DBG}" ]] && echo "kubectl for k3s setup complete." fi diff --git a/_home/private_dot_config/sz.env/truenas-scale.env b/_home/private_dot_config/sz.env/truenas-scale.env index d89614a..f14b8fd 100644 --- a/_home/private_dot_config/sz.env/truenas-scale.env +++ b/_home/private_dot_config/sz.env/truenas-scale.env @@ -5,6 +5,14 @@ if is_cmd midclt; then if [ -e "$SCALE_POOL_ROOT/jailmaker/jlmkr.py" ]; then #alias jlmkr="bash -c '_jlmkr() { $SCALE_POOL_ROOT/jailmaker/jlmkr.py \${@:---help}; }; _jlmkr \$@' " function jlmkr() { sudo $SCALE_POOL_ROOT/jailmaker/jlmkr.py "${@:---help}"; } + + jlmkr-zellij() { + zellij action go-to-tab-name --create "jailmkr" + zellij action new-pane --name "${1:?must pass jail name}@jlmkr" -- sh -ci "reset; sudo $SCALE_POOL_ROOT/jailmaker/jlmkr.py shell --uid ${UID} ${1}" + zellij action focus-previous-pane + zellij action close-pane + } + fi fi fi diff --git a/_home/private_dot_local/bin/executable_load-zellij b/_home/private_dot_local/bin/executable_load-zellij index 90d7608..0a6deb2 100644 --- a/_home/private_dot_local/bin/executable_load-zellij +++ b/_home/private_dot_local/bin/executable_load-zellij @@ -15,9 +15,9 @@ BASE_SHELL=$(basename "$SHELL") if is_sourced; then zellij-cleanup() { - [[ -r "$HOME/bin/zellij" ]] && rm "$HOME/bin/zellij" - [[ -d "$HOME/.cache/zellij" ]] && rm -fR "$HOME/.cache/zellij" - [[ -d /tmp/zellij ]] && rm -fR /tmp/zellij + type -pa zellij > /dev/null && type -pa zellij | sed -Ee 's/^.* is //' | awk '{ print $1 }' | grep -E "^$HOME" | xargs -tr rm + [[ -d "$HOME/.cache/zellij" ]] && echo "$HOME/.cache/zellij" | xargs -rt rm -fR + find /tmp -maxdepth 1 -mindepth 1 -type d -name 'zellij*' -print0 | xargs -r0t rm -fR printf 'Zellij has been cleaned up, you can now reinstall it.\n' } zellij() { @@ -38,11 +38,14 @@ if is_sourced; then fi } + zellij-completion() { if [[ "${BASE_SHELL}" == "zsh" ]]; then . <( zellij setup --generate-completion zsh | sed -Ee 's/^(_(zellij) ).*/compdef \1\2/' ) else . <( zellij setup --generate-completion "$BASE_SHELL" ) fi + } + zellij-completion # Was needed when zsh would load # . <( zellij setup --generate-completion "$BASE_SHELL" | sed -ne '/^function/,$p' ) if [[ -z "$ZELLIJ_SESSION_NAME" ]]; then