dotfiles/scripts/.local/bin/setup_development.sh

27 lines
661 B
Bash
Raw Permalink Normal View History

#!/bin/bash
BASE_DIR=$1
SESSION_ID=${PWD##*/}
if [ -e "$BASE_DIR/Pipfile" ]; then
COMMAND_PREFIX="pipenv run "
SHELL_COMMAND="pipenv shell"
echo "Pipenv"
else
COMMAND_PREFIX=""
SHELL_COMMAND="/bin/bash"
fi
cd $BASE_DIR
tmux new-session -d -s $SESSION_ID ${SHELL_COMMAND}
tmux rename-window "${SESSION_ID}"
tmux select-window -t $SESSION_ID:1
tmux split-window -h "${COMMAND_PREFIX}nvim && ${SHELL_COMMAND}"
tmux split-window -h "${SHELL_COMMAND}"
tmux select-layout even-horizontal
tmux split-window -v -t 1 "${SHELL_COMMAND}"
tmux split-window -v -t 4 "ranger && ${SHELL_COMMAND}"
tmux select-pane -t 3
tmux -2 attach-session -t $SESSION_ID