-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmuxgo
executable file
·33 lines (31 loc) · 1.1 KB
/
.tmuxgo
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
#!/bin/bash
SESSION=`basename $PWD`
ENVNAME='eco_mocks_catls_cam'
# Creating new session
tmux -2 new-session -d -s $SESSION `cd $PWD`
# Renaming window
tmux rename-window -t $SESSION:0 main
# Splitting panes and windows
tmux split-window -v
tmux select-pane -t 0
tmux resize-pane -D 15
tmux select-pane -t 1
tmux split-window -h
tmux select-pane -t 2
tmux resize-pane -L 10
# Sending commands
tmux send -t $SESSION:0.0 "cd $PWD; conda deactivate; conda activate $ENVNAME; clear;" ENTER
tmux send -t $SESSION:0.1 "cd $PWD; conda deactivate; conda activate $ENVNAME; clear; htop" ENTER
tmux send -t $SESSION:0.2 "cd $PWD; conda deactivate; conda activate $ENVNAME; cd ./data; clear" ENTER
#
# Creating new windows
tmux new-window -t $SESSION:1 -n 'misc'
tmux send -t $SESSION:1.0 "cd $PWD; conda deactivate; conda activate $ENVNAME; clear;" ENTER
# Creating new windows
tmux new-window -t $SESSION:2 -n 'extras'
tmux send -t $SESSION:2.0 "cd $PWD; conda deactivate; conda activate $ENVNAME; clear;" ENTER
#
# Selecting which window to start at
tmux select-window -t $SESSION:0
tmux select-pane -t 0
tmux -2 attach -t $SESSION