-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.sh
52 lines (46 loc) · 1.49 KB
/
tmux.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
tmux start-server
tmux kill-session -t enoengine_session
session="enoengine_session"
window="enoengine_window"
enoengine="EnoEngine"
enolauncher="EnoLauncher"
enoflagsink="EnoFlagSink"
enomaintenance="EnoMaintenance"
run_enolauncher="dotnet run --project EnoLauncher"
run_enoflagsink="dotnet run --project EnoFlagSink"
run_enoengine="dotnet run --project EnoEngine"
# EnoLauncher (Top Left)
enolauncher_id=$(
tmux new-session -P -F "#{pane_id}" -n "$window" -s "$session" -d "bash --rcfile <( cat << EOF
. ~/.bashrc
history -s $run_enolauncher
$run_enolauncher
EOF
)"
)
tmux select-pane -t "$session:$window.$enolauncher_id" -T "$enolauncher"
# EnoFlagSink (Top Right)
enoflagsink_id=$(
tmux split-pane -P -F "#{pane_id}" -h -t "$session:$window.$enolauncher_id" "bash --rcfile <( cat << EOF
. ~/.bashrc
history -s $run_enoflagsink
$run_enoflagsink
EOF
)"
)
tmux select-pane -t "$session":"$window"."$enoflagsink_id" -T "$enoflagsink"
# Sleep in order to not start a race condition between launcher and Engine
sleep 3
# EnoEngine (Bottom Left)
enoengine_id=$(tmux split-pane -v -t "$session:$window.$enolauncher_id" "bash --rcfile <( cat << EOF
. ~/.bashrc
history -s $run_enoengine
$run_enoengine
EOF
)"
)
tmux select-pane -t "$session":"$window"."$enoengine_id" -T "$enoengine"
# EnoMaintenance (Bottom Right)
enomaintenance_id=$(tmux split-pane -v -t "$session:$window.$enoflagsink_id" "bash --rcfile <(echo 'echo EnoM 3')")
tmux select-pane -t "$session":"$window"."$enomaintenance_id" -T "$enomaintenance"