-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmuxgo
executable file
·32 lines (30 loc) · 1.03 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
#!/bin/bash
SESSION=`basename $PWD`
ENVNAME='ml'
# Creating new session
tmux -2 new-session -d -s $SESSION `cd $PWD`
# ------ Main window ------
# 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
# Sending commands
tmux send -t $SESSION:0.1 "cd $PWD; conda activate $ENVNAME; source $SHELL ;clear; htop" ENTER
#
# ------ Miscellaneous window ------
tmux new-window -t $SESSION:1 -n 'misc'
tmux send -t $SESSION:1.0 "cd $PWD; conda activate $ENVNAME; source $SHELL ; clear;" ENTER
# ------ Extras window ------
tmux new-window -t $SESSION:2 -n 'extras'
tmux send -t $SESSION:2.0 "cd $PWD; conda activate $ENVNAME; source $SHELL ; clear;" ENTER
# ------ Jupyter window ------
tmux new-window -t $SESSION:3 -n 'jupyter'
tmux send -t $SESSION:3.0 "cd $PWD; conda activate $ENVNAME; source $SHELL ; clear;" ENTER
#
# Selecting which window to start at
tmux select-window -t $SESSION:0
tmux select-pane -t 0
tmux -2 attach -t $SESSION