dotfiles/home/bin/executable_tmux-dot

18 lines
418 B
Bash

#!/bin/sh
DIR="~/.local/share/chezmoi"
SESSION="Dots"
SESSIONEXISTS=$(tmux list-sessions | grep $SESSION)
if [ "$SESSIONEXISTS" = "" ]
then
tmux new-session -s $SESSION -d
tmux rename-window -t $SESSION:1 'Edit'
tmux send-keys -t 'Edit' "cd ${DIR}" C-m 'nvim' C-m
tmux new-window -t $SESSION:2 -n 'Term'
tmux send-keys -t 'Term' "cd ${DIR}" C-m 'clear' C-m
fi
tmux attach-session -t $SESSION:1