Include tmux project init script
This commit is contained in:
parent
747a1fe584
commit
d174718477
1 changed files with 33 additions and 0 deletions
33
files/tmux.sh
Executable file
33
files/tmux.sh
Executable file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
session_name=${PWD##*/}
|
||||||
|
project_directory="$HOME/development/$session_name"
|
||||||
|
enable_formatting=""
|
||||||
|
|
||||||
|
tmux has-session -t $session_name
|
||||||
|
|
||||||
|
if [ $? != 0 ];
|
||||||
|
then
|
||||||
|
tmux new-session \
|
||||||
|
-c $project_directory \
|
||||||
|
-ds $session_name \
|
||||||
|
-e "project_dir=$project_directory"
|
||||||
|
|
||||||
|
# FIRST WINDOW
|
||||||
|
tmux send-keys -t $session_name:0 'source ./env/bin/activate' C-m
|
||||||
|
tmux send-keys -t $session_name:0 'nvim' C-m
|
||||||
|
|
||||||
|
# SECOND WINDOW
|
||||||
|
tmux new-window -t $session_name
|
||||||
|
|
||||||
|
# THIRD WINDOW
|
||||||
|
tmux new-window -t $session_name
|
||||||
|
|
||||||
|
# FOURTH WINDOW
|
||||||
|
tmux new-window -t $session_name
|
||||||
|
|
||||||
|
# SELECT DEFAULT PANE AFTER OPENING
|
||||||
|
tmux select-window -t $session_name:0
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmux attach -t $session_name
|
||||||
Loading…
Add table
Add a link
Reference in a new issue