Created
August 23, 2011 04:44
-
-
Save mengstr/1164361 to your computer and use it in GitHub Desktop.
Open some tmux windows/panes and start apps in them
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/bash | |
SESSION=$USER | |
# if the session is already running, just attach to it. | |
tmux has-session -t $SESSION | |
if [ $? -eq 0 ]; then | |
tmux attach -t $SESSION | |
exit 0; | |
fi | |
tmux set-window-option -t $SESSION -g automatic-rename off | |
tmux -u new-session -d -s $SESSION | |
tmux send-keys -t $SESSION:0 'cd via/' C-m | |
tmux new-window -t $SESSION:1 -n constatus | |
tmux send-keys -t $SESSION:1 'cd via/constatus/; ./start.sh' C-m | |
tmux new-window -t $SESSION:2 -n frontend | |
tmux send-keys -t $SESSION:2 'cd via/frontend/; ./start.sh' C-m | |
tmux new-window -t $SESSION:3 -n test | |
tmux select-window -t $SESSION:3 | |
tmux split-window -h | |
tmux split-window -v | |
tmux send-keys -t $SESSION:3.0 'cd via/test/; supervisor f.js' C-m | |
tmux send-keys -t $SESSION:3.1 'cd via/test/' C-m | |
tmux send-keys -t $SESSION:3.1 'telnet localhost ' | |
tmux send-keys -t $SESSION:3.2 'cd via/test/' C-m | |
tmux send-keys -t $SESSION:3.2 'telnet localhost ' | |
tmux -2 -u attach -t $SESSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment