Created
October 15, 2020 21:14
-
-
Save nickkaczmarek/7e7c7e950fa3c6fe2e05c2dc63e43e7e to your computer and use it in GitHub Desktop.
starttmux.sh for windows
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 | |
session="work" | |
if ( ps aux | grep tmux ) | |
then | |
echo tmux is running | |
tmux attach-session -t $session | |
else | |
echo tmux is not running | |
# Start New Session with our name | |
tmux new-session -d -s $session | |
# Name first Window | |
tmux rename-window -t $session 'sitecore' | |
tmux send-keys -t $session 'cd /c/dev/hyland-sitecore && clear' C-m | |
# split the window in half and go to the webapp to run npm | |
tmux split-pane -v -p 50 | |
tmux selectp -t 2 | |
tmux send-keys -t $session 'cd /c/dev/hyland-sitecore/WebApp && clear && npm start' C-m | |
# create and name second window | |
tmux new-window -t $session:2 -n "blog" | |
tmux send-keys -t 'blog' "cd /c/Users/nkaczmarek/source/repos/nickkaczmarek.com" C-m 'clear' C-m | |
# select the work window and | |
tmux select-window -t 'sitecore' | |
tmux select-pane -t 1 | |
tmux attach-session -t $session | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment