This repository was archived by the owner on May 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.tmux-ready
More file actions
executable file
·37 lines (28 loc) · 1.31 KB
/
.tmux-ready
File metadata and controls
executable file
·37 lines (28 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env sh
SESSION_NAME="$(basename "$PWD" | tr ".,:" "___")"
FILE_MANAGER="yazi"
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
# Window 1: helix
tmux rename-window -t "$SESSION_NAME:1" helix
tmux send-keys -t "$SESSION_NAME:1" "helix" C-m
# Window 2: docker compose
tmux new-window -t "$SESSION_NAME:2" -n "docker"
tmux split-window -t "$SESSION_NAME:2" -l 50%
tmux send-keys -t "$SESSION_NAME:2.0" "clear && docker compose up" C-m
tmux send-keys -t "$SESSION_NAME:2.1" "clear && sleep 3 && psql -U rt -h localhost -d codeuniverse -p 5432" C-m
# Window 3: goose
tmux new-window -t "$SESSION_NAME:3" -n "goose" -c "$PWD/migrations"
# Window 4: make
tmux new-window -t "$SESSION_NAME:4" -n "make"
tmux split-window -t "$SESSION_NAME:4" -l 50%
tmux send-keys -t "$SESSION_NAME:4.0" "clear && source .env && make watch" C-m
# Window 5: shell
tmux new-window -t "$SESSION_NAME:5" -n "shell"
# Window 6: ssh
tmux new-window -t "$SESSION_NAME:6" -n "ssh"
# Custom binding to reload make
tmux bind u run-shell "tmux display-message 'Restarting make...'; tmux send-keys -t '$SESSION_NAME:4.0' C-c 'make watch' C-m"
tmux bind e display-popup -w 80% -h 80% -E "tmux new-session $FILE_MANAGER \; set status off"
# Focus on window 1
tmux select-window -t "$SESSION_NAME:1"
fi