#!/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 # 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 # Runners window tmux new-window -n Lazydocker -t ${IVIDEON_ROOT} change_dir_and_activate_root_env False tmux send-keys "lazydocker" C-m # Git manipulation window tmux new-window -n Project -t ${IVIDEON_ROOT} # Go to project directory and acivate env change_dir_and_activate_root_env False # 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 # 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 tmux attach -t ${IVIDEON_ROOT}:IDE