added two scripts for zellij
This commit is contained in:
parent
9d21258b7b
commit
fd47b9e969
2 changed files with 18 additions and 0 deletions
8
dot_local/bin/executable_zellijCreateLayout
Normal file
8
dot_local/bin/executable_zellijCreateLayout
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
ZJ_LAYOUT_DIR=$(zellij setup --check | grep "LAYOUT DIR" - | grep -o '".*"' - | tr -d '"')
|
||||||
|
|
||||||
|
if [[ -d "${ZJ_LAYOUT_DIR}" ]]; then
|
||||||
|
ZJ_LAYOUT="$(fd --type file . "${ZJ_LAYOUT_DIR}" | sed 's|.*/||' | fzf || exit)"
|
||||||
|
zellij --layout "${ZJ_LAYOUT}"
|
||||||
|
fi
|
10
dot_local/bin/executable_zellijList
Normal file
10
dot_local/bin/executable_zellijList
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
ZJ_SESSIONS=$(zellij list-sessions)
|
||||||
|
NO_SESSIONS=$(echo "${ZJ_SESSIONS}" | wc -l)
|
||||||
|
|
||||||
|
if [ "${NO_SESSIONS}" -ge 2 ]; then
|
||||||
|
zellij attach \
|
||||||
|
"$(echo "${ZJ_SESSIONS}" | fzf)"
|
||||||
|
else
|
||||||
|
zellij attach -c
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue