-
Notifications
You must be signed in to change notification settings - Fork 0
/
zsh_install.sh
executable file
·38 lines (26 loc) · 1.03 KB
/
zsh_install.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
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
ping baidu.com -c 2 > /dev/null
if [ $? -ne 0 ] ;then
clear
echo -e "\e[1;31mError: 当前网络不可用\e[0m" && exit
fi
# sudo pacman -S zsh git yay cowsay lsd fortune-mod --noconfirm && clear
sudo pacman -S zsh git lsd fortune-mod --noconfirm && clear
echo -e "\e[1;32mInfo: 基本软件安装完成! \e[0m"
echo -e "\e[1;33mInfo: 更换默认shell\e[0m"
chsh -s /bin/zsh > /dev/null
# install oh-my-zsh
echo -e "\e[1;33mInfo: 正在安装 oh-my-zsh ! \e[0m"
chmod +x ./script/oh-my-zsh.sh
sh -c ./script/oh-my-zsh.sh > /dev/null && clear
echo -e "\e[1;32mInfo: oh-my-zsh 安装完成 !"
# import config
cat ./zshrc > $HOME/.zshrc
echo -e "\e[1;32mInfo: 导入配置成功!\e[0m"
# deploy plugins
echo -e "\e[1;33mInfo: 正在导入插件\e[0m"
cp plugins ~/.zsh -r
# install powerlevel10k
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# install end
echo -e "\e[1;32mInfo: 配置完成!\ndone." && sleep 1 && clear && exec zsh