Tmux: Update some scripts
This commit is contained in:
parent
e3928d25e4
commit
2b3b3d743f
3 changed files with 6 additions and 98 deletions
|
|
@ -4,7 +4,7 @@ IVIDEON_SESSION_NAME=Backend
|
||||||
PERSONAL_SESSION_NAME=Personal
|
PERSONAL_SESSION_NAME=Personal
|
||||||
OTHER_SESSION_NAME=Other
|
OTHER_SESSION_NAME=Other
|
||||||
|
|
||||||
IVIDEON_REPO_ROOT_PATH="/home/user/Work/root"
|
IVIDEON_REPO_ROOT_PATH="/home/work/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
|
||||||
|
|
@ -14,7 +14,7 @@ change_dir_and_activate_root_env(){
|
||||||
tmux send-keys "cd ${IVIDEON_REPO_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/user/Work/root/venv/bin/activate" C-m
|
tmux send-keys "source /home/work/Work/root/venv/bin/activate" C-m
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clear terminal
|
# Clear terminal
|
||||||
|
|
@ -40,7 +40,8 @@ tmux resize-pane -D 15
|
||||||
# Git manipulation window
|
# Git manipulation window
|
||||||
tmux new-window -n cloud-env -t ${IVIDEON_SESSION_NAME}
|
tmux new-window -n cloud-env -t ${IVIDEON_SESSION_NAME}
|
||||||
# Go to project directory and acivate env
|
# Go to project directory and acivate env
|
||||||
tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}" C-m
|
change_dir_and_activate_root_env
|
||||||
|
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
|
||||||
|
|
@ -76,8 +77,6 @@ tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}/ivideon/api_concept" C-m
|
||||||
# Create new session for personal use
|
# Create new session for personal use
|
||||||
tmux new-ses -d -s ${PERSONAL_SESSION_NAME} -n Programming
|
tmux new-ses -d -s ${PERSONAL_SESSION_NAME} -n Programming
|
||||||
tmux new-window -n VPN -t ${PERSONAL_SESSION_NAME}
|
tmux new-window -n VPN -t ${PERSONAL_SESSION_NAME}
|
||||||
tmux new-window -n Obsidian -t ${PERSONAL_SESSION_NAME}
|
|
||||||
tmux send-keys "cd /home/user/Documents/t0xa_vault" C-m
|
|
||||||
|
|
||||||
# ---- Session: Other ----
|
# ---- Session: Other ----
|
||||||
|
|
||||||
|
|
@ -90,3 +89,4 @@ change_dir_and_activate_root_env False
|
||||||
|
|
||||||
tmux attach -t "$IVIDEON_SESSION_NAME:IDE"
|
tmux attach -t "$IVIDEON_SESSION_NAME:IDE"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ bind-key -r -T prefix C-Right resize-pane -R 10
|
||||||
bind-key o switch-client -T my_table
|
bind-key o switch-client -T my_table
|
||||||
|
|
||||||
# Bind keys within that table
|
# Bind keys within that table
|
||||||
bind-key -T my_table o switch-client -t Personal:3
|
bind-key -T my_table o switch-client -t Personal:2
|
||||||
bind-key -T my_table i switch-client -t Backend:1
|
bind-key -T my_table i switch-client -t Backend:1
|
||||||
bind-key -T my_table c switch-client -t Backend:3
|
bind-key -T my_table c switch-client -t Backend:3
|
||||||
# bind-key -T my_table p switch-client -t Other:1
|
# bind-key -T my_table p switch-client -t Other:1
|
||||||
|
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
IVIDEON_SESSION_NAME=Backend
|
|
||||||
PERSONAL_SESSION_NAME=Personal
|
|
||||||
OTHER_SESSION_NAME=Other
|
|
||||||
|
|
||||||
IVIDEON_REPO_ROOT_PATH="/home/user/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 ${IVIDEON_REPO_ROOT_PATH}" C-m
|
|
||||||
|
|
||||||
if [[ "$env_activate" != "False" ]]; then
|
|
||||||
tmux send-keys "source /home/user/Work/root/venv/bin/activate" C-m
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clear terminal
|
|
||||||
tmux send-keys "clear" C-m
|
|
||||||
}
|
|
||||||
|
|
||||||
# Kill IVIDEON_SESSION_NAME if existst
|
|
||||||
tmux kill-ses -t "${IVIDEON_SESSION_NAME}"
|
|
||||||
tmux kill-ses -t "${PERSONAL_SESSION_NAME}"
|
|
||||||
tmux kill-ses -t "${OTHER_SESSION_NAME}"
|
|
||||||
|
|
||||||
# Create detached sesssion with default IDE window
|
|
||||||
tmux new-ses -d -s ${IVIDEON_SESSION_NAME} -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
|
|
||||||
# Git manipulation window
|
|
||||||
tmux new-window -n cloud-env -t ${IVIDEON_SESSION_NAME}
|
|
||||||
# Go to project directory and acivate env
|
|
||||||
change_dir_and_activate_root_env
|
|
||||||
tmux send-keys "cd ${IVIDEON_REPO_ROOT_PATH}/ivideon/tests" C-m
|
|
||||||
tmux send-keys "clear" C-m
|
|
||||||
|
|
||||||
# Scripts manipulation window
|
|
||||||
tmux new-window -n Scripts -t ${IVIDEON_SESSION_NAME}
|
|
||||||
# Go to scripts directory
|
|
||||||
change_dir_and_activate_root_env False
|
|
||||||
|
|
||||||
# Bash manipulation window
|
|
||||||
tmux new-window -n Bash -t ${IVIDEON_SESSION_NAME}
|
|
||||||
change_dir_and_activate_root_env False
|
|
||||||
|
|
||||||
# Runners window
|
|
||||||
tmux new-window -n Lazydocker -t ${IVIDEON_SESSION_NAME}
|
|
||||||
change_dir_and_activate_root_env False
|
|
||||||
tmux send-keys "lazydocker" C-m
|
|
||||||
|
|
||||||
# Git window 1
|
|
||||||
tmux new-window -n "git->service" -t ${IVIDEON_SESSION_NAME}
|
|
||||||
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"
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue