Created
February 5, 2015 14:37
-
-
Save zacharydanger/7a86d76c90ab9a8ce07c to your computer and use it in GitHub Desktop.
My tmux script for blogging
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 | |
SESSION=blog | |
PROJECT_DIR=~/Projects/zdc | |
tmux has-session -t $SESSION | |
if [ $? != 0 ] | |
then | |
echo "Creating a new session. This shit's going to be dope." | |
tmux new-session -s $SESSION -n editor -d | |
tmux send-keys -t $SESSION "cd $PROJECT_DIR" C-m | |
tmux set-option -t $SESSION default-path $PROJECT_DIR | |
tmux new-window -n console -t $SESSION | |
tmux split-window -v -p 20 -t $SESSION:1.0 | |
tmux send-keys -t $SESSION:1.1 "clear && cd $PROJECT_DIR && bundle exec jekyll serve --watch --drafts" C-m | |
tmux send-keys -t $SESSION:1.0 "clear && cd $PROJECT_DIR && git status" C-m | |
tmux select-pane -t $SESSION:0.0 | |
tmux select-window -t $SESSION:0 | |
# open "http://localhost:4000" | |
fi | |
tmux attach -t $SESSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment