I use tmux
to manage my projects:
## ... to test if environment is OK
# Do I have a session $PROJECT
tmux has-session -t $PROJECT 2>/dev/null
if [ $? = 0 ]; then
tmux attach-session -t $1
else
if [ $TERM = "screen" ]; then # in a tmux session
echo You are now in a tmux session which will be detached.
echo Please run the command again.
tmux detach-client
else
tmux new-session -d -s $PROJECT \; \
splitw -h -p 66 \; \
splitw -h \; \
splitw -v -p 24 \; \
attach-session \; \
select-pane -t 0 \; \
splitw -v -p 89 \; \
send-keys -t 1 cd\ $ddat Enter \; \
send-keys -t 0 figlet\ -cw\ 99\ $PROJECT Enter \; \
send-keys -t 2 cd\ $dprj/src Enter \; \
send-keys -t 3 cd\ $dprj/src Enter \; \
send-keys -t 3 ec\ $PROJECT.jl Enter \; \
send-keys -t 4 cd\ $dprj Enter \; \
send-keys -t 4 julia Enter \; \
send-keys -t 4 ] \; \
send-keys -t 4 update Enter \; \
send-keys -t 4 activate\ . Enter \; \
send-keys -t 4 update Enter \; \
send-keys -t 4 ^h \; \
send-keys -t 4 using\ Revise Enter \; \
send-keys -t 4 using\ $PROJECT Enter \; \
select-pane -t 2
fi
fi
can of course be improved. tmux
grammer is not very good. This is also for a 32’’ screen. I can then have a project title, a data, 2 editor, and 1 repl panes.