You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
720 B
32 lines
720 B
#!/bin/sh
|
|
# export PATH=$PATH:/usr/local/bin
|
|
|
|
# abort if we're already inside a TMUX session
|
|
[ "$TMUX" == "" ] || exit 0
|
|
# startup a "default" session if non currently exists
|
|
# tmux has-session -t _default || tmux new-session -s _default -d
|
|
|
|
# present menu for user to choose which workspace to open
|
|
PS3="Please choose your session: "
|
|
options=($(tmux list-sessions -F "#S") "New Session" "zsh")
|
|
echo "Available sessions"
|
|
echo "------------------"
|
|
echo " "
|
|
select opt in "${options[@]}"
|
|
do
|
|
case $opt in
|
|
"New Session")
|
|
read -p "Enter new session name: " SESSION_NAME
|
|
tmux -2 new -s "$SESSION_NAME"
|
|
break
|
|
;;
|
|
"zsh")
|
|
zsh --login
|
|
break;;
|
|
*)
|
|
tmux -2 attach-session -t $opt
|
|
break
|
|
;;
|
|
esac
|
|
done
|