Skip to content

Instantly share code, notes, and snippets.

@jayroh
Created April 23, 2016 19:55
Show Gist options
  • Save jayroh/141fd4c8801ed31176178f75a575c547 to your computer and use it in GitHub Desktop.
Save jayroh/141fd4c8801ed31176178f75a575c547 to your computer and use it in GitHub Desktop.
thredded gem tmuxify
#!/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