2020-05-16 19:48:40 +02:00
|
|
|
#!/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
|
2023-08-04 23:30:34 +02:00
|
|
|
wget -xqO ~/.oh-my-zsh/custom/themes/rainbow.zsh-theme https://scm.i-blacknet.de/mkurz/rainbow-zsh-theme/raw/branch/master/rainbow.zsh-theme
|
2020-05-16 19:48:40 +02:00
|
|
|
mkdir -p ~/.oh-my-zsh/custom/plugins/rainbow-alias/
|
2023-08-04 23:30:34 +02:00
|
|
|
wget -xqO ~/.oh-my-zsh/custom/plugins/rainbow-alias/rainbow-alias.plugin.zsh https://scm.i-blacknet.de/mkurz/rainbow-zsh-theme/raw/branch/master/rainbow-alias.plugin.zsh
|
2020-05-16 19:48:40 +02:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|