Skip to content

Instantly share code, notes, and snippets.

@scbunn
Created March 12, 2017 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scbunn/2cfc2953d1db356cab5cae353c409a91 to your computer and use it in GitHub Desktop.
Save scbunn/2cfc2953d1db356cab5cae353c409a91 to your computer and use it in GitHub Desktop.
Function to launch a new TMUX session ready for salt formula development
function saltdev () {
if [[ $TMUX ]]; then
tmux new-window -n "SaltDev $1"
tmux split-window -v
tmux split-window -v
tmux select-pane -t 0
tmux resize-pane -y 10
tmux select-pane -t 2
tmux resize-pane -y 15
tmux select-pane -t 1
tmux split-window -h
tmux select-pane -t 1
tmux resize-pane -x 120
tmux select-pane -t 0
tmux send-keys 'docker stats --format "table {{.Name}}\t{{.ID}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{ .BlockIO}}\t{{.PIDs}}"' C-m
tmux select-pane -t 1
tmux send-keys "workon $1" C-m
tmux send-keys "clear" C-m
tmux send-keys 'vim' C-m
tmux select-pane -t 2
tmux send-keys "workon $1" C-m
tmux send-keys "clear" C-m
tmux select-pane -t 3
tmux send-keys "workon $1" C-m
tmux send-keys "clear" C-m
tmux select-pane -t 1
else
echo "Skipping, not in a tmux session"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment