diff --git a/scripts/tmuster_ivideon b/scripts/tmuster_ivideon new file mode 100755 index 0000000..8a4dbb6 --- /dev/null +++ b/scripts/tmuster_ivideon @@ -0,0 +1,62 @@ +#!/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 diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 464deb8..228f0c8 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -23,6 +23,7 @@ set-option -g renumber-windows on # Open panes in the same directory bind '"' split-window -v -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" # set vi-mode set-window-option -g mode-keys vi