Skip to content

Instantly share code, notes, and snippets.

@raskchanky
Created March 19, 2014 16:30
Show Gist options
  • Save raskchanky/9645530 to your computer and use it in GitHub Desktop.
Save raskchanky/9645530 to your computer and use it in GitHub Desktop.
Shell script for pre-defined tmux split arrangements
#!/bin/bash
set -e
name=`date | md5`
tmux new-session -d -s $name
tmux split-window -h -p 40
if [ "$1" = "2" ]
then
# 2 on the right side, 50/50
tmux split-window -v
elif [ "$1" = "22" ]
then
# 3 on the right side, 50/25/25
tmux split-window -v
tmux split-window -v
elif [ "$1" = "3" ]
then
# 3 on the right side, 34/33/33
tmux split-window -v -p 66
tmux split-window -v
elif [ "$1" = "4" ]
then
# 4 on the right side, 25/25/25/25
tmux split-window -v
tmux split-window -v
tmux select-pane -t 1
tmux split-window -v
fi
tmux select-pane -t 0
tmux -2 attach-session -t $name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment