From cae4c661593d20f8280385c96a3351ee3c680fe2 Mon Sep 17 00:00:00 2001 From: pro100ton Date: Thu, 5 Dec 2024 22:31:31 +0300 Subject: [PATCH] Add tmux starter script --- scripts/tmuster | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 scripts/tmuster diff --git a/scripts/tmuster b/scripts/tmuster new file mode 100755 index 0000000..f72ed3f --- /dev/null +++ b/scripts/tmuster @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +session=Backend +# PROJECT_PATH=/home/t0xa/Documents/Backend/ +# SCRIPTS_PATH=/home/t0xa/Documents/Scripts/ + +PROJECT_PATH="/home/pro100ton/Documents/Development/Python/python_asyncio_course/" +SCRIPTS_PATH=/home/pro100ton/Documents/Development/configs_collection/ + +# Kill session if existst +tmux kill-ses -t "${session}" + +# Create detached sesssion with default IDE window +tmux new-session -d -s ${session} -n IDE +# Go to project path +tmux send-keys "cd ${PROJECT_PATH} && poetry run nvim" C-m # C-m means "hit enter" +# Split IDE window in half +tmux split-window -v +# Some resizing +tmux resize-pane -D 15 +# Go to project directory +tmux send-keys "cd ${PROJECT_PATH}" C-m # C-m means "hit enter" +tmux send-keys "poetry shell" C-m # C-m means "hit enter" +tmux send-keys "clear" C-m # C-m means "hit enter" + +# Create additional windows +# +# Runners window +tmux new-window -n Runners -t ${session} +# Go to project directory and acivate env +tmux send-keys "cd ${PROJECT_PATH} && poetry shell" C-m # C-m means "hit enter" +tmux split-window -v +# Go to project directory and acivate env +tmux send-keys "cd ${PROJECT_PATH} && poetry shell" C-m # C-m means "hit enter" + +# Git manipulation window +tmux new-window -n Git -t ${session} +# Go to project directory and acivate env +tmux send-keys "cd ${PROJECT_PATH}" C-m # C-m means "hit enter" +tmux send-keys "lazygit" C-m # C-m means "hit enter" + +# Scripts manipulation window +tmux new-window -n Scripts -t ${session} +# Go to scripts directory +tmux send-keys "cd ${SCRIPTS_PATH} && clear" C-m # C-m means "hit enter" + +# Bash manipulation window +tmux new-window -n Bash -t ${session} + +# Attach to created workspace +tmux attach -t ${session}:IDE