diff --git a/tmux.sh b/tmux.sh new file mode 100644 index 0000000..7e19dba --- /dev/null +++ b/tmux.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +SESSION_NAME="nix" +WORK_DIR="/Users/yanlin/.config/nix" + +if tmux has-session -t $SESSION_NAME 2>/dev/null; then + tmux attach-session -t $SESSION_NAME + exit 0 +fi + +tmux new-session -d -s $SESSION_NAME -c "$WORK_DIR" +tmux rename-window -t $SESSION_NAME:1 "nvim" +tmux send-keys -t $SESSION_NAME:1 "nvim" C-m +tmux new-window -t $SESSION_NAME:2 -n "ai" +tmux send-keys -t $SESSION_NAME:2 "claude -r" C-m +tmux split-window -t $SESSION_NAME:2 -h +tmux split-window -t $SESSION_NAME:2.2 -v +tmux select-pane -t $SESSION_NAME:2.1 +tmux new-window -t $SESSION_NAME:3 -n "bash" + +tmux select-window -t $SESSION_NAME:1 + +tmux attach-session -t $SESSION_NAME