Skip to content

Instantly share code, notes, and snippets.

@zacharydanger
Created February 5, 2015 14:37
Show Gist options
  • Save zacharydanger/7a86d76c90ab9a8ce07c to your computer and use it in GitHub Desktop.
Save zacharydanger/7a86d76c90ab9a8ce07c to your computer and use it in GitHub Desktop.
My tmux script for blogging
#!/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