-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_zsh.sh
executable file
·58 lines (50 loc) · 1.66 KB
/
install_zsh.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Adapted bits from https://github.com/jldeen/dotfiles/blob/wsl/configure.sh
# Feel free to go get the original if you are more fond of Zsh than Bash.
sudo apt-get update
sudo apt install zsh -y git bash-completion
# oh-my-zsh install
if [ -d ~/.oh-my-zsh/ ]; then
echo ''
echo "oh-my-zsh is already installed..."
read -p "Would you like to update oh-my-zsh now?" -n 1 -r
echo ''
if [[ $REPLY =~ ^[Yy]$ ]]; then
if cd ~/.oh-my-zsh && git pull; then
echo "Update complete..."
cd || true
else
echo "Update not complete..." cd >&2
fi
fi
else
echo "oh-my-zsh not found, now installing oh-my-zsh..."
echo ''
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# oh-my-zsh plugin install
echo ''
echo "Now installing oh-my-zsh plugins..."
echo ''
git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
git clone git://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
# powerlevel9k install
echo ''
echo "Now installing powerlevel9k..."
echo ''
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
# Set default shell to zsh
echo ''
read -p "Do you want to change your default shell? y/n" -n 1 -r
echo ''
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Now setting default shell..."
if chsh -s "$(which zsh)"; then
echo "Successfully set your default shell to zsh..."
else
echo "Default shell not set successfully..." >&2
fi
else
echo "You chose not to set your default shell to zsh. Exiting now..."
fi