Skip to content

Instantly share code, notes, and snippets.

@ebrensi
Created June 9, 2022 20:46
Show Gist options
  • Save ebrensi/eeef790f1e2ad8d2f8ef298bb3a578ff to your computer and use it in GitHub Desktop.
Save ebrensi/eeef790f1e2ad8d2f8ef298bb3a578ff to your computer and use it in GitHub Desktop.
Bash script to start tmux with
#!/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