Skip to content

Instantly share code, notes, and snippets.

@hartmut27
Last active April 30, 2020 07:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hartmut27/a1932efaf73453b3cf9d0061f441deea to your computer and use it in GitHub Desktop.
Save hartmut27/a1932efaf73453b3cf9d0061f441deea to your computer and use it in GitHub Desktop.
One-click Quadruple Monitoring Startup Script (tmux automate): Jest watch, Alcotest watch, Backend HTTP-Server watch, Frontend HTTP-Server watch
#!/bin/sh
tmux new-session -s 'S1' \; \
attach -t 'S1' \; \
set -g pane-border-status top \; \
set -g base-index 1 \; \
set -g pane-base-index 1 \; \
rename-window -t 0 'W0' \; \
\
select-pane -T "Jest watch" \; \
send-keys 'npm run watch:test' C-m \; \
\
split-window -v -p 34 \; \
select-pane -T "Backend HTTP-Server" \; \
send-keys 'esy build dune exec backend/App.exe' C-m \; \
\
split-window -h -p 55 \; \
select-pane -T "Frontend HTTP-Server" \; \
send-keys 'npm run server' C-m \; \
\
select-pane -t 1 \; \
split-window -h -p 45 \; \
select-pane -T "Alcotest watch" \; \
send-keys 'esy watch:test' C-m \;
@hartmut27
Copy link
Author

hartmut27 commented Apr 20, 2020

if you move the script above in to a separate .tmux config file, you can ommit the semicolons and newlines at each end of line (thx to @the_spyder!).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment