2023-10-27 16:50:35 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-10-27 21:18:58 +03:00
|
|
|
function showcom()
|
|
|
|
{
|
|
|
|
echo "- ${@/eval/}"
|
|
|
|
"$@"
|
|
|
|
}
|
|
|
|
|
2023-10-27 16:52:42 +03:00
|
|
|
# Check if necessary things are installed
|
2023-10-27 21:26:29 +03:00
|
|
|
if [ ! command -v git &> /dev/null ]; then
|
2023-10-27 17:12:07 +03:00
|
|
|
echo "This script requires git and zsh"
|
2023-10-27 16:52:42 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-10-27 16:50:35 +03:00
|
|
|
|
|
|
|
# Asking if user really want to install
|
2023-10-27 21:18:58 +03:00
|
|
|
read -p 'This script will replace ~/.zshrc with its own. If you still want to run it, type "y": ' -n 1 -r
|
2023-10-27 16:50:35 +03:00
|
|
|
echo
|
|
|
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-10-27 21:18:58 +03:00
|
|
|
echo "Installing..."
|
|
|
|
if ! test -f ~/.oh-my-zsh/oh-my-zsh.sh; then
|
|
|
|
showcom eval "rm -rf ~/.oh-my-zsh"
|
|
|
|
showcom eval "git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh --depth 1 > /dev/null 2>&1"
|
|
|
|
showcom eval "rm -rf ~/.oh-my-zsh/.git"
|
|
|
|
fi
|
|
|
|
showcom eval "git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting --depth 1 > /dev/null 2>&1"
|
|
|
|
showcom eval "rm -rf ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/.git"
|
|
|
|
showcom eval "wget -O ~/.zshrc https://nakidai.ddns.net/nakidai/dotfiles/raw/branch/master/zsh/.zshrc > /dev/null 2>&1"
|
|
|
|
showcom eval "wget -O ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/headline.zsh-theme https://nakidai.ddns.net/nakidai/dotfiles/raw/branch/master/zsh/headline.zsh-theme > /dev/null 2>&1"
|
|
|
|
echo "Done"
|