-
Notifications
You must be signed in to change notification settings - Fork 2
/
start-all
executable file
·51 lines (37 loc) · 1.03 KB
/
start-all
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
#!/bin/sh
#
# Setup a work space called `peshead` with two windows
# first window has 3 panes.
#
session="peshead"
if ( $(tmux has-session -t $session 2>/dev/null) ); then
tmux attach-session -t $session
else
# set up tmux
tmux start-server
# create a new tmux session, starting vim from a saved session in the new window
tmux new-session -d -s $session -n serve
# Select pane 1, FE server
tmux selectp -t 1
tmux send-keys "yarn start" C-m
tmux selectp -t 1
tmux splitw -v -p 70
# PANE 2, functions watch
tmux selectp -t 2
tmux send-keys "cd functions; yarn watch" C-m
tmux selectp -t 2
tmux splitw -v -p 66
# PANE 3, functions server
tmux selectp -t 3
tmux send-keys "yarn server" C-m
# PANE 4, general scratch
tmux splitw -v -p 50
# Select pane 1
# tmux selectp -t 1
# create a new window called scratch
tmux new-window -t $session:1 -n scratch
# return to main vim window
tmux select-window -t $session:0
# Finished setup, attach to the tmux session!
tmux attach-session -t $session
fi