Created
March 27, 2013 12:28
-
-
Save ecthiender/5253810 to your computer and use it in GitHub Desktop.
Tmux session initiation script:
creates a new tmux session or attaches to an existing one.
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/sh | |
# tmux session initialisation script | |
# change the following config to your preferences | |
SESSION="work" | |
workspace1="$HOME/server/www" | |
workspace2="$HOME/codeyard" | |
tmux has-session -t $SESSION > /dev/null | |
if [[ $? -eq 0 ]] | |
then | |
echo "Session exists\n" | |
tmux attach-session -t $SESSION | |
exit 0; | |
fi | |
echo "Creating new session $SESSION\n" | |
cd $workspace1 | |
tmux new-session -d -s $SESSION -n www-dev | |
cd $workspace2 | |
tmux new-window -t $SESSION:2 -n codeyard | |
tmux select-window -t $SESSION:1 | |
tmux attach-session -t $SESSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment