#!/usr/bin/bash cd ~ # get os_id for zsh installtion if [[ -r /etc/os-release ]]; then os_id=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') fi # check if zsh shell installed if [[ ! -f "/usr/bin/zsh" || ! -f "/bin/zsh" ]]; then case $os_id in *arch*|*manjaro*) sudo pacman -S zsh --noconfirm ;; *debian*|*ubuntu*|*raspbian*) sudo apt install zsh -y ;; *) esac fi # check if oh my zsh installed if [ ! -d "~/.oh-my-zsh" ]; then sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended chsh -s $(which zsh) fi # install rainbow theme & alias plugin wget -xqO ~/.oh-my-zsh/custom/themes/rainbow.zsh-theme https://gitea.mkex.de/blacknet76/rainbow-zsh-theme/raw/branch/master/rainbow.zsh-theme mkdir -p ~/.oh-my-zsh/custom/plugins/rainbow-alias/ wget -xqO ~/.oh-my-zsh/custom/plugins/rainbow-alias/rainbow-alias.plugin.zsh https://gitea.mkex.de/blacknet76/rainbow-zsh-theme/raw/branch/master/rainbow-alias.plugin.zsh # install needfull plugins git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting # set rainbow as theme sed -i.bak 's/^[[:space:]]*ZSH_THEME=.*/ZSH_THEME="rainbow"/' .zshrc # add neefull plugins sed -i -e 's/\(^plugins=([^)]*\)/\1 rainbow-alias zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting/' .zshrc