2022-07-04 16:06:23 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
CURRENTDIR="$(pwd)"
|
|
|
|
GREEN="\033[32m"
|
|
|
|
RED="\033[31m"
|
2022-07-05 08:15:27 +03:00
|
|
|
CLEAR_COLOR="\033[0m"
|
2022-07-04 16:06:23 +03:00
|
|
|
|
2022-07-05 08:15:27 +03:00
|
|
|
echo "${GREEN}Welcome to ivabus .dotfiles installer$CLEAR_COLOR"
|
2022-07-04 16:06:23 +03:00
|
|
|
echo "Dotfiles will be installed to $HOME/.dotfiles"
|
|
|
|
echo "Press enter to continue"
|
|
|
|
read A
|
|
|
|
|
|
|
|
# check for zsh
|
|
|
|
|
|
|
|
if ! command -v zsh > /dev/null
|
|
|
|
then
|
|
|
|
echo "zsh is not installed"
|
2022-07-05 08:15:27 +03:00
|
|
|
echo "${RED}Aborting.$CLEAR_COLOR"
|
2022-07-04 16:06:23 +03:00
|
|
|
exit 255
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install oh-my-zsh and plugins
|
2022-07-05 08:15:27 +03:00
|
|
|
echo "${GREEN}Installing oh-my-zsh and plugins$CLEAR_COLOR"
|
2022-07-05 08:20:37 +03:00
|
|
|
ZSH="$HOME/.dotfiles/oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended > /dev/null 2>&1
|
|
|
|
curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.dotfiles/oh-my-zsh/custom/themes/ivabus.zsh-theme > /dev/null 2>&1
|
|
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.dotfiles/oh-my-zsh/custom/plugins/zsh-syntax-highlighting > /dev/null 2>&1
|
|
|
|
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.dotfiles/oh-my-zsh/custom/plugins/zsh-autosuggestions > /dev/null 2>&1
|
2022-07-04 16:06:23 +03:00
|
|
|
|
|
|
|
# linking dotfiles to their original locations
|
|
|
|
|
2022-07-05 08:15:27 +03:00
|
|
|
echo "${GREEN}Linking binaries$CLEAR_COLOR"
|
|
|
|
|
2022-07-04 16:06:23 +03:00
|
|
|
sh $HOME/.dotfiles/tools/relink.sh
|
|
|
|
|
|
|
|
cd $CURRENTDIR
|
|
|
|
|
2022-07-05 08:16:45 +03:00
|
|
|
if [[ $(uname) = "Darwin" ]]
|
2022-07-04 17:48:20 +03:00
|
|
|
then
|
2022-07-05 08:28:55 +03:00
|
|
|
sh $HOME/.dotfiles/tools/mac.sh
|
2022-07-04 17:48:20 +03:00
|
|
|
fi
|
|
|
|
|
2022-07-05 08:15:27 +03:00
|
|
|
echo "${GREEN}Dotfiles installed and linked.$CLEAR_COLOR"
|
2022-07-04 17:07:17 +03:00
|
|
|
read -p "Would you like to configure git? (y/N): " answer
|
|
|
|
if [[ $answer = [Yy] ]]; then
|
2022-07-05 08:28:55 +03:00
|
|
|
sh $HOME/.dotfiles/tools/git.sh
|
2022-07-04 17:48:20 +03:00
|
|
|
fi
|
|
|
|
|
2022-07-05 08:26:29 +03:00
|
|
|
chmod +x $HOME/.dotfiles/tools/*
|
|
|
|
|
2022-07-04 17:48:20 +03:00
|
|
|
exec zsh
|