mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
adding scripts/zs
This commit is contained in:
parent
8af67be13a
commit
f087422bbf
1 changed files with 20 additions and 0 deletions
20
scripts/zs
Executable file
20
scripts/zs
Executable file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
LAYOUT=code
|
||||||
|
|
||||||
|
if [[ $# -eq 1 ]]; then
|
||||||
|
selected=$(realpath $1)
|
||||||
|
else
|
||||||
|
DIRECTORIES=$(cat ~/.tmuxs | sed "s&^\~&${HOME}&g")
|
||||||
|
selected=$(find ${DIRECTORIES} -mindepth 1 -maxdepth 1 -type d | fzf)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $selected ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
selected_name=$(basename "$selected" | tr . _)
|
||||||
|
|
||||||
|
zellij --layout "$LAYOUT" \
|
||||||
|
attach -c "$selected_name" \
|
||||||
|
options --default-cwd "$selected"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue