This commit is contained in:
Aaron Bieber 2020-08-18 07:44:57 -06:00
parent 48b86a835e
commit 42a0c0ce47

36
bin/tstart Executable file
View File

@ -0,0 +1,36 @@
#!/bin/ksh
set -eu
SNAME="Main"
SSES="-s ${SNAME}"
IDX=1
if tmux ls | grep -q "^${SNAME}:"; then
tmux -u2 at -t "${SNAME}"
else
tmux -2 new-session -d $SSES
if [ -e ~/.tmux.windows ]; then
count=${IDX}
for n in $(cat ~/.tmux.windows); do
if [ $n == "_" ]; then
tmux new-window
else
if [ $count -eq ${IDX} ]; then
tmux rename-window "${n}"
else
tmux new-window -n "${n}"
fi
fi
((count=count+1))
done
else
tmux rename-window "IRC"
tmux new-window -n "Mail"
tmux new-window -n "Music"
tmux new-window
fi
tmux select-window -t${IDX}
tmux -2 attach-session -t $SNAME
fi