Tmux: add tmux-sessionizer script

This commit is contained in:
pr0c3550r 2023-10-21 18:40:54 +02:00
parent 4f2cc2d4af
commit f481ef6cc5

View file

@ -0,0 +1,12 @@
#!/usr/bin/bash
read -p "New session name: " SEL
if [[ -z $SEL ]]; then
echo "No session name specified"
exit 1
fi
SEL_NAME=$(tr "[:lower:]" "[:upper:]" <<< "$SEL")
WORK_DIR=$(find ~ -not -path "*/.*" -type d -print 2>/dev/null | fzf)
tmux new-session -d -s "$SEL_NAME" -c "$WORK_DIR"
tmux switch-client -t "$SEL_NAME"