62 lines
1.7 KiB
Bash
Executable File
62 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Settings
|
|
USER_HOME="$HOME"
|
|
USER_LOCAL="$USER_HOME/.local"
|
|
USER_CONFIGS="$USER_HOME/.config"
|
|
USER_CACHE="$USER_HOME/.cache"
|
|
|
|
DATA_LOC="$USER_HOME/Data"
|
|
APPDATA="$DATA_LOC/AppData"
|
|
CONFIGS="$APPDATA/configs"
|
|
SCRIPTS="$APPDATA/bin"
|
|
SOURCES="$APPDATA/src"
|
|
CACHE="$APPDATA/cache"
|
|
|
|
NEOVIM_VERSION="0.10.3"
|
|
|
|
OMZ_DIR="$USER_HOME/.oh-my-zsh"
|
|
ZSH_CUSTOM="$OMZ_DIR/custom"
|
|
ZSH_THEMES="$ZSH_CUSTOM/themes"
|
|
|
|
# Spaceship Prompt for OMZ
|
|
SSP_URL="https://github.com/spaceship-prompt/spaceship-prompt.git"
|
|
SSP_DIR="$ZSH_THEMES/spaceship-prompt"
|
|
SSP_LINK_NAME="$ZSH_THEMES/spaceship.zsh-theme"
|
|
SSP_LINK_TARGET="$SSP_DIR/spaceship.zsh-theme"
|
|
|
|
# Store the current working directory
|
|
CWD="$(pwd -P)"
|
|
|
|
# Download and setup oh-my-zsh, assuming zsh is installed
|
|
if [ -x "$(command -v zsh)" ]; then
|
|
if ! [ -d "$OMZ_DIR" ]; then
|
|
echo "Cloning OhMyZSH"
|
|
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || exit 1
|
|
echo "Finished Cloning OhMyZSH."
|
|
fi
|
|
|
|
# Clone the Spaceship Prompt theme and link it
|
|
if ! [ -d "$SSP_DIR" ]; then
|
|
echo "Cloning spaceship-prompt for ohmyzsh."
|
|
git clone "$SSP_URL" "$SSP_DIR" --depth=1 || exit 1
|
|
fi
|
|
|
|
if ! [ -L "$SSP_LINK_NAME" ]; then
|
|
echo "Linking spaceship prompt into omz themes"
|
|
ln -s "$SSP_LINK_TARGET" "$SSP_LINK_NAME" || exit 1
|
|
fi
|
|
|
|
# Change user shell to zsh
|
|
echo "Changing user shell to zsh."
|
|
chsh --shell "$(command -v zsh)"
|
|
fi
|
|
|
|
if ! [ -d "$CONFIGS/nvim" ]; then
|
|
# Setup my neovim config
|
|
cd "USER_HOME"
|
|
git clone "https://github.com/aargonian/nvim-config" "$CONFIGS/nvim" || exit 1
|
|
# ln -s "$CONFIGS/Neovim Config" "$USER_CONFIGS/nvim" || exit 1
|
|
cd "$CWD"
|
|
fi
|