Skip to content

Instantly share code, notes, and snippets.

@cbosco
Created June 25, 2015 19:49
Show Gist options
  • Save cbosco/69d1c4c5c1e4f54b45ac to your computer and use it in GitHub Desktop.
Save cbosco/69d1c4c5c1e4f54b45ac to your computer and use it in GitHub Desktop.
Terry Li's open_tmux.sh
#!/bin/bash
set -e
CURRENT_SESSION=${PWD##*/}
# Do we have rakefile in the directory?
if [ ! -f Rakefile ]
then
echo 'Rakefile not found in current directory'
exit 1;
fi
# Start up the tmux session with specific name
tmux new-session -d -s $CURRENT_SESSION
# VIM window
tmux send-keys 'vim' 'C-m'
tmux rename-window vim
# Rspec window for running tests
tmux new-window
tmux rename-window rspec
# Window for running development servers
tmux new-window
tmux rename-window servers
# Select the first window
tmux select-window -t 1
# Attach the tmux session
tmux attach -t $CURRENT_SESSION
pmset noidle&
t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment