tmux: Add ivideon tmuster script
This commit is contained in:
parent
5d72c3c1ba
commit
da2e707294
1 changed files with 65 additions and 0 deletions
|
|
@ -0,0 +1,65 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
IVIDEON_ROOT=Backend
|
||||
PERSONAL_ROOT=Personal
|
||||
|
||||
ROOT_PATH="/home/t0xa/Work/root"
|
||||
|
||||
change_dir_and_activate_root_env(){
|
||||
# Get first argument and set True if not provided
|
||||
local env_activate="${1:-True}"
|
||||
|
||||
# Go to project path
|
||||
tmux send-keys "cd ${ROOT_PATH}" C-m
|
||||
|
||||
if [[ "$env_activate" != "False" ]]; then
|
||||
tmux send-keys "source /home/t0xa/Work/root/venv/bin/activate" C-m
|
||||
fi
|
||||
|
||||
# Clear terminal
|
||||
tmux send-keys "clear" C-m
|
||||
}
|
||||
|
||||
# Kill IVIDEON_ROOT if existst
|
||||
tmux kill-ses -t "${IVIDEON_ROOT}"
|
||||
tmux kill-ses -t "${PERSONAL_ROOT}"
|
||||
|
||||
# Create detached sesssion with default IDE window
|
||||
tmux new-ses -d -s ${IVIDEON_ROOT} -n IDE
|
||||
tmux send-keys "nvim bootstrap.py" C-m
|
||||
# Go to project path
|
||||
change_dir_and_activate_root_env True
|
||||
# Split IDE window in half
|
||||
tmux split-window -v
|
||||
change_dir_and_activate_root_env False
|
||||
# Some resizing
|
||||
tmux resize-pane -D 15
|
||||
|
||||
# Create additional windows
|
||||
# Git manipulation window
|
||||
tmux new-window -n cloud-env -t ${IVIDEON_ROOT}
|
||||
# Go to project directory and acivate env
|
||||
change_dir_and_activate_root_env
|
||||
tmux send-keys "cd ${ROOT_PATH}/ivideon/tests" C-m
|
||||
tmux send-keys "clear" C-m
|
||||
|
||||
# Scripts manipulation window
|
||||
tmux new-window -n Scripts -t ${IVIDEON_ROOT}
|
||||
# Go to scripts directory
|
||||
change_dir_and_activate_root_env False
|
||||
|
||||
# Bash manipulation window
|
||||
tmux new-window -n Bash -t ${IVIDEON_ROOT}
|
||||
change_dir_and_activate_root_env False
|
||||
|
||||
# Runners window
|
||||
tmux new-window -n Lazydocker -t ${IVIDEON_ROOT}
|
||||
change_dir_and_activate_root_env False
|
||||
tmux send-keys "lazydocker" C-m
|
||||
|
||||
# Create new session for personal use
|
||||
tmux new-ses -d -s ${PERSONAL_ROOT} -n Programming
|
||||
tmux new-window -n VPN -t ${PERSONAL_ROOT}
|
||||
|
||||
# Attach to created workspace
|
||||
t
|
||||
Loading…
Reference in a new issue