Created
March 12, 2017 16:53
-
-
Save scbunn/2cfc2953d1db356cab5cae353c409a91 to your computer and use it in GitHub Desktop.
Function to launch a new TMUX session ready for salt formula development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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