mirror of
https://github.com/vbrandl/dotfiles
synced 2025-08-31 00:00:21 +02:00
Add custom scripts
This commit is contained in:
31
bin/tm
Executable file
31
bin/tm
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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" 2>/dev/null) "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 new -s "$SESSION_NAME"
|
||||
break
|
||||
;;
|
||||
"zsh")
|
||||
zsh --login
|
||||
break;;
|
||||
*)
|
||||
tmux attach-session -t $opt
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# vim: set filetype=sh ts=4 sw=4 tw=120 noet :
|
Reference in New Issue
Block a user