Updated fix-kubectl, added load-zellij
This commit is contained in:
parent
c6022128ec
commit
0c20efd44d
2 changed files with 56 additions and 9 deletions
28
load-zellij
Executable file
28
load-zellij
Executable file
|
@ -0,0 +1,28 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
BASE_0="$(basename ${0#-})"
|
||||
BASE_SHELL="$(basename "$SHELL")"
|
||||
|
||||
if [[ -z "${BASE_0}" || "${BASE_0}" == "$BASE_SHELL" ]]; then
|
||||
zellij() {
|
||||
if [[ -x /tmp/zellij/bootstrap/zellij ]]; then
|
||||
/tmp/zellij/bootstrap/zellij "${@}"
|
||||
else
|
||||
bash <(curl -sL zellij.dev/launch) "${@}"
|
||||
fi
|
||||
}
|
||||
. <( zellij setup --generate-completion "$BASE_SHELL" )
|
||||
if [[ -z "$ZELLIJ_SESSION_NAME" ]]; then
|
||||
(zellij list-sessions 2&>1) > /dev/null || zellij attach -c $USER@$(hostname)
|
||||
fi
|
||||
|
||||
elif [[ "$1" == '-' ]]; then
|
||||
cat "${BASH_SOURCE[0]}"
|
||||
else
|
||||
SCRIPT_NAME="$BASE_0"
|
||||
printf '%s\n' \
|
||||
"It seems $SCRIPT_NAME was invoked as a script. It should be sourced instead." \
|
||||
'The easiest way is to call it like this:' \
|
||||
" $ . <( $SCRIPT_NAME - ) # Note the '-' after the script's name" \
|
||||
''
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue