Created
June 9, 2022 20:46
-
-
Save ebrensi/eeef790f1e2ad8d2f8ef298bb3a578ff to your computer and use it in GitHub Desktop.
Bash script to start tmux with
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# open a split-window tmux session with | |
# backend server in one pane and | |
# parcel watch frontend builder in the other | |
session="geminae-webdev" | |
root="~/dev/geminae" | |
sessionexists=$(tmux list-sessions | grep $session) | |
if [ "$sessionexists" = "" ] | |
then | |
tmux new-session -d -s $session | |
tmux send-keys "source $root/.venv/geminae-backend/bin/activate" C-m | |
tmux send-keys "cd $root/Client; npm run watch" C-m | |
tmux split-window -h | |
tmux send-keys "source $root/.venv/geminae-backend/bin/activate" C-m | |
tmux send-keys "cd $root; python server.py" C-m | |
tmux split-window -v | |
tmux send-keys "source $root/.venv/geminae-backend/bin/activate" C-m | |
tmux send-keys "cd $root; code .; tig" C-m | |
fi | |
tmux attach-session -t $session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment