Created
April 23, 2016 19:55
-
-
Save jayroh/141fd4c8801ed31176178f75a575c547 to your computer and use it in GitHub Desktop.
thredded gem tmuxify
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
#!/bin/zsh | |
tmux has-session -t thredded 2>/dev/null | |
if [ "$?" -eq 1 ] ; then | |
echo "Project not found. Creating and configuring." | |
# Set up primary window | |
tmux new-session -d -s thredded | |
tmux rename-window "vim" | |
tmux send-keys -t 1 'vim .' Enter | |
tmux split-window -h -p 25 | |
tmux select-pane -t 1 | |
# Set up rails server and zeus | |
tmux neww -n servers | |
tmux select-window -t :2 | |
tmux split-window -v -p 80 | |
tmux send-keys -t 2 'rake dev' Enter | |
# Head back to primary window | |
tmux select-window -t :1 | |
else | |
echo "Project found. Connecting." | |
fi | |
TERM=screen-256color-bce tmux attach-session -t thredded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment