1
1
Fork 0

Improved zsh installation steps

This commit is contained in:
Jo Wroten 2019-08-04 15:46:43 -05:00
parent f2a6c2e87d
commit b87b7c6cd1

View file

@ -1,17 +1,39 @@
#!/bin/bash
echo " - Installing Zsh - "
sudo apt-get install zsh
echo "🤔 Checking for Zsh installation"
if zsh --version; then
echo "🥰 Zsh is already installed"
else
echo "🤩 Installing Zsh"
sudo apt-get install zsh
echo "👍 Zsh Installed"
fi
echo " - Setting Zsh as default - "
echo "🦄 Setting Zsh as default shell"
sudo chsh -s /usr/bin/zsh
echo "👍 Zsh set as default shell, will take effect next time you log in (or type zsh into your terminal)"
echo " - Installing oh-my-zsh - "
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "🤔 Checking for oh-my-zsh installation"
if [ -d ~/.oh-my-zsh ]; then
echo "🥰 oh-my-zsh is already installed"
else
echo "🤩 Installing oh-my-zsh"
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "👍 oh-my-zsh Installed"
fi
echo " - Setting oh-my-zsh theme -"
echo "🤔 Checking for zsh-autosuggestions installation"
if [ -d ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ]; then
echo "🥰 zsh-autosuggestions is already installed"
else
echo "🤩 Installing zsh-autosuggestions"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sed -ri 's/plugins=\((.*?)\)/plugins=\(git zsh-autosuggestions\)/g' ~/.zshrc
echo "👍 zsh-autosuggestions Installed"
fi
echo "🦄 Setting oh-my-zsh theme"
sed -ri 's/ZSH_THEME="(.*?)"/ZSH_THEME="kardan"/g' ~/.zshrc
source ~/.zshrc
echo "👍 Set oh-my-zsh theme"
echo " - Setting up Zsh Plugins - "
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sed -ri 's/plugins=\((.*?)\)/plugins=\(git zsh-autosuggestions\)/g' ~/.zshrc
source ~/.zshrc
echo "👍 Sourced updated zshrc"