Tmux: add tmux-sessionizer script
This commit is contained in:
parent
4f2cc2d4af
commit
f481ef6cc5
1 changed files with 12 additions and 0 deletions
12
tmux/.config/tmux/tmux-sessionizer
Executable file
12
tmux/.config/tmux/tmux-sessionizer
Executable 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"
|
Loading…
Add table
Add a link
Reference in a new issue