Created
June 25, 2015 19:49
-
-
Save cbosco/69d1c4c5c1e4f54b45ac to your computer and use it in GitHub Desktop.
Terry Li's open_tmux.sh
This file contains hidden or 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 | |
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