tmux: update ivideon starter script

This commit is contained in:
t0xa 2025-09-09 08:26:44 +03:00
parent d369aa1f79
commit 15c1062b32

View file

@ -1,32 +1,33 @@
#!/usr/bin/env bash #!/usr/bin/env bash
IVIDEON_ROOT=Backend IVIDEON_SESSION_NAME=Backend
PERSONAL_ROOT=Personal PERSONAL_SESSION_NAME=Personal
OTHER_SESSION_NAME=Other
ROOT_PATH="/home/t0xa/Work/root" IVIDEON_REPO_ROOT_PATH="/home/user/Work/root"
change_dir_and_activate_root_env(){ change_dir_and_activate_root_env(){
# Get first argument and set True if not provided # Get first argument and set True if not provided
local env_activate="${1:-True}" local env_activate="${1:-True}"
# Go to project path # Go to project path
tmux send-keys "cd ${ROOT_PATH}" C-m tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}" C-m
if [[ "$env_activate" != "False" ]]; then if [[ "$env_activate" != "False" ]]; then
tmux send-keys "source /home/t0xa/Work/root/venv/bin/activate" C-m tmux send-keys "source /home/user/Work/root/venv/bin/activate" C-m
fi fi
# Clear terminal # Clear terminal
tmux send-keys "clear" C-m tmux send-keys "clear" C-m
} }
# Kill IVIDEON_ROOT if existst # Kill IVIDEON_SESSION_NAME if existst
tmux kill-ses -t "${IVIDEON_ROOT}" tmux kill-ses -t "${IVIDEON_SESSION_NAME}"
tmux kill-ses -t "${PERSONAL_ROOT}" tmux kill-ses -t "${PERSONAL_SESSION_NAME}"
tmux kill-ses -t "${OTHER_SESSION_NAME}"
# Create detached sesssion with default IDE window # Create detached sesssion with default IDE window
tmux new-ses -d -s ${IVIDEON_ROOT} -n IDE tmux new-ses -d -s ${IVIDEON_SESSION_NAME} -n IDE
tmux send-keys "nvim bootstrap.py" C-m
# Go to project path # Go to project path
change_dir_and_activate_root_env True change_dir_and_activate_root_env True
# Split IDE window in half # Split IDE window in half
@ -37,29 +38,55 @@ tmux resize-pane -D 15
# Create additional windows # Create additional windows
# Git manipulation window # Git manipulation window
tmux new-window -n cloud-env -t ${IVIDEON_ROOT} tmux new-window -n cloud-env -t ${IVIDEON_SESSION_NAME}
# Go to project directory and acivate env # Go to project directory and acivate env
change_dir_and_activate_root_env change_dir_and_activate_root_env
tmux send-keys "cd ${ROOT_PATH}/ivideon/tests" C-m tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}/ivideon/tests" C-m
tmux send-keys "clear" C-m tmux send-keys "clear" C-m
# Scripts manipulation window # Scripts manipulation window
tmux new-window -n Scripts -t ${IVIDEON_ROOT} tmux new-window -n Scripts -t ${IVIDEON_SESSION_NAME}
# Go to scripts directory # Go to scripts directory
change_dir_and_activate_root_env False change_dir_and_activate_root_env False
# Bash manipulation window # Bash manipulation window
tmux new-window -n Bash -t ${IVIDEON_ROOT} tmux new-window -n Bash -t ${IVIDEON_SESSION_NAME}
change_dir_and_activate_root_env False change_dir_and_activate_root_env False
# Runners window # Runners window
tmux new-window -n Lazydocker -t ${IVIDEON_ROOT} tmux new-window -n Lazydocker -t ${IVIDEON_SESSION_NAME}
change_dir_and_activate_root_env False change_dir_and_activate_root_env False
tmux send-keys "lazydocker" C-m tmux send-keys "lazydocker" C-m
# Create new session for personal use # Git window 1
tmux new-ses -d -s ${PERSONAL_ROOT} -n Programming tmux new-window -n "git->service" -t ${IVIDEON_SESSION_NAME}
tmux new-window -n VPN -t ${PERSONAL_ROOT} change_dir_and_activate_root_env False
tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}/ivideon/ivideon" C-m
# Git window 2
tmux new-window -n "git->tests" -t ${IVIDEON_SESSION_NAME}
change_dir_and_activate_root_env False
tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}/ivideon/tests" C-m
# Git window 3
tmux new-window -n "git->api5" -t ${IVIDEON_SESSION_NAME}
tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}/ivideon/api_concept" C-m
# ---- Session: Programming ----
# Create new session for personal use
tmux new-ses -d -s ${PERSONAL_SESSION_NAME} -n Programming
tmux new-window -n VPN -t ${PERSONAL_SESSION_NAME}
# ---- Session: Other ----
# Create new session for other usecases use
tmux new-ses -d -s ${OTHER_SESSION_NAME} -n Other
tmux new-window -n CLI -t ${OTHER_SESSION_NAME}
change_dir_and_activate_root_env False
# ----- Attach to created environment -----
tmux attach -t "$IVIDEON_SESSION_NAME:IDE"
# Attach to created workspace
t