From b30b3935413d869bc8fecb85dcf30676d76e21f7 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 26 Jul 2025 09:37:30 +0200 Subject: [PATCH] Add tmux session script for nix configuration workspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create automated tmux session setup with 3 windows: nvim, ai, and bash - Auto-start nvim in first window and claude in ai window with split panes - Provides quick workspace initialization for nix config development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- tmux.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tmux.sh 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