Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Last active May 20, 2019 17:41
Show Gist options
  • Save tennisonchan/350bd5029e7553fe655815c5db0d00ae to your computer and use it in GitHub Desktop.
Save tennisonchan/350bd5029e7553fe655815c5db0d00ae to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Setup a work space called `pinboard` with one window and 3 panes.
#
SESSION_NAME="ads-eng"
WINDON_NAME="pinboard"
# check if session already exists
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
# set up tmux
tmux start-server
# create a new tmux session, starting vim from a saved session in the new window
tmux new-session -d -s ${SESSION_NAME} -n ${WINDON_NAME}
# select pane 0, run sterling
tmux selectp -t 0
# split pane 0 horizontal
tmux split-window -h
# select pane 1, run optimun
tmux selectp -t 1
# split pane 1 vertiacally
tmux split-window -v -t ${SESSION_NAME}:0.1
fi
tmux send-keys -t ${SESSION_NAME}:0.1 "dev" C-m
tmux send-keys -t ${SESSION_NAME}:0.1 "opt" C-m
tmux send-keys -t ${SESSION_NAME}:0.0 "dev" C-m
tmux send-keys -t ${SESSION_NAME}:0.0 "pin" C-m
tmux send-keys -t ${SESSION_NAME}:0.2 "dev" C-m
tmux send-keys -t ${SESSION_NAME}:0.2 "bulk" C-m
tmux selectp -t 0
# Finished setup, attach to the tmux session!
tmux attach-session -t ${SESSION_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment