Skip to content

Instantly share code, notes, and snippets.

@thameera
Created April 16, 2013 16:27
Show Gist options
  • Save thameera/5397373 to your computer and use it in GitHub Desktop.
Save thameera/5397373 to your computer and use it in GitHub Desktop.
Sample bash script to draw a tmux layout
#!/bin/bash
SN="tmuxwork"
tmux has-session -t $SN &>/dev/null
if [ $? != 0 ]
then
tmux new -s $SN -n conf -d
tmux new-window -t $SN:2 -n misc
tmux select-window -t $SN:1
tmux send-keys "vi ~/.tmux.conf" C-m
tmux split-window -h -p 50 # split vertically by 50%
tmux select-pane -t 0
fi
tmux -2 attach -t $SN
@adamkovesdi
Copy link

This is great, thanks for sharing.
It inspired me to add my own layout scripts to tmux workflows.

@thameera
Copy link
Author

thameera commented May 2, 2020

Glad to hear you found it useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment