-
Notifications
You must be signed in to change notification settings - Fork 0
/
total-shell.sh
executable file
·26 lines (22 loc) · 1.07 KB
/
total-shell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
platform=$(uname)
theme="s|robbyrussell|powerlevel10k/powerlevel10k|"
plugins='s|^plugins=(git)$|plugins=(git ruby colorize zsh-autosuggestions zsh-syntax-highlighting)|'
flag="-i"
if [[ $platform == 'Linux' ]]; then
echo "Linux detected";
sudo apt install -y zsh
chsh -s $(which zsh)
echo 'export PATH="'$PATH':$PATH"' >> $HOME/.zshrc
sudo cat $HOME/.zshrc >> /root/.zshrc
elif [[ $platform == 'Darwin' ]]; then
echo "macOS detected";
flag="-i ''"
fi
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
cat $HOME/.zshrc.pre-oh-my-zsh >> $HOME/.zshrc
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sed $flag "$theme" $HOME/.zshrc;
sed $flag "$plugins" $HOME/.zshrc;