-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_tmux_server.sh
More file actions
executable file
·40 lines (28 loc) · 1.19 KB
/
Copy pathstart_tmux_server.sh
File metadata and controls
executable file
·40 lines (28 loc) · 1.19 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
38
39
40
#!/usr/bin/env bash
###### This file is version controlled in git ######
SESSION="minecraft"
# Kill existing session cleanly
tmux kill-session -t "$SESSION" 2>/dev/null
# Create the session and first window
tmux new-session -d -s "$SESSION" -n "Minecraft"
# Pane 0 (left): Minecraft server
tmux send-keys -t "$SESSION":0.0 'cd ~/paper_minecraft && ./start.sh' C-m
# Split right vertically to create pane 1
tmux split-window -h -t "$SESSION":0.0
# Split pane 1 into 3 horizontal sections (panes 1, 2, and 3)
tmux split-window -v -t "$SESSION":0.1
tmux split-window -v -t "$SESSION":0.1
# Resize panes
tmux resize-pane -t "$SESSION":0.0 -x 77
tmux resize-pane -t "$SESSION":0.1 -y 18
tmux resize-pane -t "$SESSION":0.2 -y 18
# Pane 1 (top right): monitor script
tmux send-keys -t "$SESSION":0.1 'cd ~ && ./minecraft_scripts/monitor.sh' C-m
# Pane 2 (middle right): join notifier
tmux send-keys -t "$SESSION":0.2 'cd ~ && ./minecraft_scripts/join_notifier.sh' C-m
# Pane 3 (bottom right): leave empty
# (optional: you could run a log tail, shell, or htop here)
# Focus left pane (optional)
tmux select-pane -t "$SESSION":0.0
# (Optional) Attach to the session automatically
tmux attach-session -t "$SESSION"