Last active
July 15, 2020 19:03
-
-
Save StolenThunda/49f0e817418510563e2391e10c422dc0 to your computer and use it in GitHub Desktop.
First version of ZSH auto installer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# According to: https://medium.com/@shivam1/make-your-terminal-beautiful-and-fast-with-zsh-shell-and-powerlevel10k-6484461c6efb | |
# Very simple ZSH install w/ no error checking | |
# Includes: | |
# - nerd fonts | |
# - powerline10k theme | |
# - auto-suggestion/syntax highlighting plugins | |
# - etc | |
# | |
# Installing from command line: | |
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/StolenThunda/49f0e817418510563e2391e10c422dc0/raw/089b77f8f52038065d5560030c01b70d00cfc4fc/zsh_autoinstall.sh)" | |
echo "Installing ZSH..." | |
apt install -y zsh | |
echo | |
echo | |
echo "Installing Oh-My-Zsh..." | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
echo | |
echo | |
echo "Install PowerLevel10K theme..." | |
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k | |
echo | |
echo | |
echo "Installing Nerd Fonts..." | |
git clone https://github.com/ryanoasis/nerd-fonts && ./nerd-fonts/install.sh | |
echo | |
echo | |
echo "Download Plugins for autosuggestion and syntax highlighting..." | |
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting | |
echo | |
echo | |
DEF_THEME=` grep ZSH_THEME -m1 .zshrc` | |
NEW_THEME='ZSH_THEME="powerlevel10k/powerlevel10k"' | |
echo "Changing theme from default $DEF_THEME to PowerLine10k..." | |
sed -i "s|${DEF_THEME}|${NEW_THEME}|g" ~/.zshrc | |
echo | |
echo | |
echo "Enabling AutoCorrection..." | |
DEF_AC="# ENABLE_CORRECTION" | |
NEW_AC="ENABLE_CORRECTION" | |
sed -i "s|${DEF_AC}|${NEW_AC}|g" ~/.zshrc | |
echo | |
echo | |
echo "Enabling plugins..." | |
DEF_PLUGINS="plugins=(git)" | |
NEW_PLUGINS="plugins=(git zsh-autosuggestions zsh-syntax-highlighting)" | |
sed -i "s|${DEF_PLUGINS}|${NEW_PLUGINS}|g" ~/.zshrc | |
echo | |
echo | |
echo "Configure your new shell..." | |
p10k configure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment