Skip to content

Instantly share code, notes, and snippets.

@bjjb
Last active October 30, 2015 15:36
Show Gist options
  • Select an option

  • Save bjjb/9d271e7252c26677f83a to your computer and use it in GitHub Desktop.

Select an option

Save bjjb/9d271e7252c26677f83a to your computer and use it in GitHub Desktop.
tmux script for a web-app project
#!/usr/bin/env sh
name="My Cool Web App Project"
serve="npm start"
watch="node_modules/.bin/cake watch"
serve="npm start"
tmux has-session -t "$name"
if [ $? != 0 ]
then
tmux new-session -d -name "$name" -n edit
tmux send-keys -t "$name":edit "vim ." C-m
tmux split-window -t "$name":edit -d -l 2
tmux send-keys -t "$name":edit.2 "$watch" C-m
tmux new-window -t "$name" -d -n server
tmux send-keys -t "$name":server ""$serve"" C-m
fi
tmux attach-session -t "$name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment