Files
dotfiles/scripts/tmux-session-setup

81 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
sess=$1
dir=$2
if [ "$dir" = "$HOME" ]; then
# 𐌲𐍂𐌹𐌼𐍉𐌹𐍂𐌴
tmux rename-window -t $sess:1 grimoire
tmux send-keys -t $sess:grimoire.1 "cd $HOME/personal/grimoire/" C-m
tmux send-keys -t $sess:grimoire.1 "vim" C-m
tmux new-window -t $sess -n dotfiles -c $HOME/dotfiles
tmux send-keys -t $sess:dotfiles.1 "vim" C-m
# sleep 1
tmux new-window -t $sess -n main -c $HOME
tmux split-window -h -b -t $sess:main.1 -l 120 -c $HOME
tmux split-window -v -b -t $sess:main.1 -l 27 -c $HOME
tmux split-window -v -b -t $sess:main.3 -l 42 -c $HOME
tmux select-pane -t $sess:main.4
tmux send-keys -t $sess:main.3 "btop" C-m
tmux send-keys -t $sess:main.2 "vim ." C-m
tmux send-keys -t $sess:main.4 "cd $HOME/Desktop && clear" C-m
# tmux send-keys -t $sess:main.1 "watch -n 5 --color fastfetch -c ~/.config/fastfetch/config.jsonc" C-m
# tmux send-keys -t $sess:main.1 "while true; do fastfetch; sleep 5; done &" C-m
(
sleep 0.1
tmux send-keys -t $sess:main.1 "fastfetch" C-m
sleep 0.2
tmux select-window -t $sess:grimoire
) &
elif [[ "$sess" == "ratry" || "$sess" == "kiwen-prototype" || "$sess" == "cpu-vs-ai" ]]; then
tmux rename-window -t $sess:1 editor
tmux send-keys -t $sess:editor.1 "nvim" C-m
tmux new-window -t $sess -n game -c $dir
tmux select-window -t $sess:editor
elif [ "$sess" = "eko" ]; then
tmux rename-window -t $sess:1 editor
tmux send-keys -t $sess:editor.1 "vim" C-m
tmux new-window -t $sess -n app -c $dir
tmux send-keys -t $sess:app "mprocs" C-m
# tmux new-window -t $sess -n app -c $dir
# tmux split-window -t $sess:app.1 -v -c $dir
# tmux send-keys -t $sess:app.2 "watchexec --exts=go './reload.sh'" C-m
# tmux resize-pane -Z -t $sess:app.1
#
# tmux new-window -t $sess -n logs -c $dir
# tmux split-window -t $sess:logs.1 -h -c $dir
# tmux split-window -t $sess:logs.2 -v -c $dir
# tmux send-keys -t $sess:logs.1 "tail -f messages.log" C-m
# tmux send-keys -t $sess:logs.2 "tail -f client.log" C-m
# tmux send-keys -t $sess:logs.3 "go run ./cmd/server --stdout" C-m
tmux select-window -t $sess:editor
elif [ "$sess" = "blockbrawl" ]; then
tmux rename-window -t $sess:1 editor
tmux send-keys -t $sess:editor.1 "vim" C-m
tmux new-window -t $sess -n server -c $dir
tmux select-window -t $sess:editor
elif [ "$sess" = "server" ]; then
tmux rename-window -t $sess:1 local
tmux new-window -t $sess -n remote -c $dir
tmux send-keys -t $sess:remote.1 "ssh root@kyren.codes" C-m
tmux new-window -t $sess -n editor -c $dir
tmux send-keys -t $sess:editor.1 "vim" C-m
tmux select-window -t $sess:remote
elif [[ "$dir" == "$HOME/projects/"* ]]; then
tmux rename-window -t $sess:1 editor
tmux send-keys -t $sess:editor.1 "vim" C-m
fi