cfg/bin/resume
Knut Ahlers 483ebb9e1e
Auto-spawn more windows
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-05-11 09:59:24 +02:00

23 lines
485 B
Bash
Executable File

#!/bin/bash
source "${HOME}/bin/script_framework.sh"
[ -n "${TMUX}" ] && fail "You are already in tmux!"
(which tmux 2>/dev/null) || fail "No tmux found, can't continue"
tmux-agent
if ! (tmux list-sessions); then
tmux new-session -d
tmux rename-window -t 1 home
tmux split-window -h
tmux new-window -n work -t 2
tmux select-window -t 2
tmux split-window -h
tmux select-window -t 1
fi
tmux attach-session -t $(tmux list-sessions | sort -n | head -n1 | cut -d: -f1)