Update Sojourner default session to be more robust
This commit is contained in:
parent
20a0e408a6
commit
ceec0b8316
1 changed files with 19 additions and 11 deletions
|
@ -1,22 +1,30 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
######
|
######
|
||||||
# Sojourner: My Default Session
|
# Sojourner: My Default Session
|
||||||
# Triple-pane Window
|
|
||||||
# Pane 1: Vim, primarily for Vimwiki Usage
|
|
||||||
# Pane 2: Large console
|
|
||||||
# Pane 3: Small console
|
|
||||||
###
|
###
|
||||||
|
|
||||||
tmux has-session -t Sojourner &>/dev/null
|
tmux has-session -t Sojourner &>/dev/null
|
||||||
|
# If there is no session named Sojourner
|
||||||
if [ $? != 0 ]
|
if [ $? != 0 ]
|
||||||
then
|
then
|
||||||
tmux new-session -s Sojourner -d
|
# Create a new session named Sojourner
|
||||||
tmux send-keys -t Sojourner 'vim' C-m
|
tmux new-session -s Sojourner -d -c ~/
|
||||||
tmux split-window -t Sojourner -h
|
# Window 1: Triple-pane, top-left is Vim
|
||||||
tmux split-window -t Sojourner:1.2 -v -p 30
|
tmux split-window -t Sojourner -v -c ~/
|
||||||
|
tmux split-window -t Sojourner:1.1 -h -c ~/
|
||||||
|
tmux resize-pane -t Sojourner:1.1 -x 85
|
||||||
|
tmux resize-pane -t Sojourner:1.2 -y 10
|
||||||
|
tmux send-keys -t Sojourner:1.1 'vim' C-m
|
||||||
|
# Window 2: 4-pane, main-vertical layout
|
||||||
|
tmux new-window -c ~/
|
||||||
|
tmux split-window -t Sojourner:2.1 -h -c ~/
|
||||||
|
tmux split-window -t Sojourner:2.1 -h -c ~/
|
||||||
|
tmux split-window -t Sojourner:2.1 -h -c ~/
|
||||||
|
tmux select-layout -t Sojourner:2 main-vertical
|
||||||
|
# Window 3: Single, full-size pane
|
||||||
|
tmux new-window -c ~/
|
||||||
|
# Focus on the first window, first pane
|
||||||
tmux select-pane -t Sojourner:1.1
|
tmux select-pane -t Sojourner:1.1
|
||||||
fi
|
fi
|
||||||
|
# Attack to the Sojourner session
|
||||||
tmux attach -t Sojourner
|
tmux attach -t Sojourner
|
||||||
|
|
Loading…
Reference in a new issue