Skip to content

Instantly share code, notes, and snippets.

@mxwell
Created November 16, 2014 20:47
Show Gist options
  • Save mxwell/a9c3c3ff2b4bf4f314c8 to your computer and use it in GitHub Desktop.
Save mxwell/a9c3c3ff2b4bf4f314c8 to your computer and use it in GitHub Desktop.
Create tmux session for contest
#! /bin/sh
# create session for round
if [ -z "$1" ]; then
echo "Round name is missing"
exit 1
fi
mkdir $1
cd $1
mkdir a b c d e
cd a
# create session with window A
tmux new-session -n 'A' -s $1 -d
# create other windows: B, C, D, E
cd ../b
tmux new-window -n 'B'
cd ../c
tmux neww -n 'C'
cd ../d
tmux neww -n 'D'
cd ../e
tmux neww -n 'E'
# return to A
tmux next
# go for work
tmux attach-session
@mxwell
Copy link
Author

mxwell commented Jan 15, 2016

#! /bin/sh

cd ~/projects
tmux new-session -n "MAIN" -d
cd ~/projects/tab1
tmux new-window -n "TAB1"
cd ~/projects/tab2
tmux new-window -n TAB2"

# return to MAIN
tmux next

# set title
tmux set-option set-titles on
tmux set-option set-titles-string LOCAL

# go to work
tmux attach-session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment