Created
February 26, 2016 15:11
-
-
Save mineroot/105242c17bc77ad26b32 to your computer and use it in GitHub Desktop.
tmux with 3 panes. Start config
This file contains 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/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