Skip to content

Instantly share code, notes, and snippets.

@mineroot
Created February 26, 2016 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mineroot/105242c17bc77ad26b32 to your computer and use it in GitHub Desktop.
Save mineroot/105242c17bc77ad26b32 to your computer and use it in GitHub Desktop.
tmux with 3 panes. Start config
#!/bin/sh
#
# change all 'somedir' and 'somecommand' entries below to directory you need and command you need accordingly
# do not forget make file executable: chmod +x .tmux-start
# run your terminal with this file e.g. for Guake: guake -e ~/.tmux-start
SESSION_NAME="dev"
cd ~/somedir
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
# Create the session
tmux new-session -s ${SESSION_NAME} -n somedir -d
# First pane
# Second pane
tmux split-window -h -t ${SESSION_NAME}:0
#tmux send-keys -t ${SESSION_NAME}:0.1 'somecommand' C-m
# Third pane
tmux split-window -v -t ${SESSION_NAME}:0 -p 10
tmux send-keys -t ${SESSION_NAME}:0.2 'somecommand' C-m
# Start out on the first window when we attach
tmux select-pane -t ${SESSION_NAME}:0.0
# Set mode mouse on
tmux set-option -g mode-mouse on
fi
tmux attach -t ${SESSION_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment