nix/tmux.sh
Yan Lin b30b393541 Add tmux session script for nix configuration workspace
- 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 <noreply@anthropic.com>
2025-07-26 09:37:30 +02:00

23 lines
658 B
Bash

#!/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