initial commit

This commit is contained in:
xesc 2023-12-09 16:35:56 +01:00
commit 21c30d2a10
2 changed files with 101 additions and 0 deletions

23
tmux-sessionizer Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/bash
HOMEDIR=~
SEL_DIR=$(find ~ -not -path "*/.*" -type d -print 2>/dev/null | fzf)
SEL_NAME=$(basename "$SEL_DIR")
if [[ -z "$SEL_DIR" ]] || [[ -n "$SEL_DIR" ]] && [[ "$SEL_DIR" == "$HOMEDIR" ]]; then
RET=0
while [[ $RET -eq 0 ]]; do
read -p "New session name: " SEL_NAME
if [[ -z "$SEL_NAME" ]]; then
clear
else
RET=1
fi
done
fi
SEL_NAME=$(tr "[:lower:]" "[:upper:]" <<< "$SEL_NAME")
tmux new-session -d -s "$SEL_NAME" -c "$SEL_DIR"
tmux switch-client -t "$SEL_NAME"