From f481ef6cc53b0faf12650f2f423147c40b3f8530 Mon Sep 17 00:00:00 2001 From: pr0c3550r Date: Sat, 21 Oct 2023 18:40:54 +0200 Subject: [PATCH] Tmux: add tmux-sessionizer script --- tmux/.config/tmux/tmux-sessionizer | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 tmux/.config/tmux/tmux-sessionizer diff --git a/tmux/.config/tmux/tmux-sessionizer b/tmux/.config/tmux/tmux-sessionizer new file mode 100755 index 0000000..62b2e63 --- /dev/null +++ b/tmux/.config/tmux/tmux-sessionizer @@ -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"