-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall
executable file
·58 lines (46 loc) · 1.5 KB
/
install
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
dirs=("amazon" "bin" "idea" "kitty" "nvim" "sway" "tmux" "zsh")
cmds_common=("fzf" "git" "nvim" "rg" "tmux")
cmds_custom=()
if [[ $OSTYPE == 'darwin'* ]]; then
cmds_custom=("brew")
else
cmds_custom=("fc-cache")
fi
all_cmds=("${cmds_common[@]}" "${cmds_custom[@]}")
for cmd in ${all_cmds[@]}; do
hash $cmd 2>/dev/null || \
{ echo >&2 "Please install \"${cmd}\" before proceeding"; exit 1; }
done
echo "Installing fonts..."
if [[ $OSTYPE == 'darwin'* ]]; then
FONT="font-sf-mono-nerd-font"
brew list $FONT || brew install --cask $FONT
else
mkdir -p ~/.local/share/fonts
git clone --depth 1 https://github.com/epk/sf-mono-nerd-font /tmp/nerdfont
cp /tmp/nerdfont/*.otf ~/.local/share/fonts
fc-cache -f -v
rm -rf /tmp/nerdfont
fi
echo "Installing tpm..."
if [ ! -d ~/.tmux/plugins/tpm ]; then
mkdir -p ~/.tmux/plugins
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
if [ ! -d ~/.oh-my-zsh ]; then
echo Please exit right after installation
sleep 3
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
rm -rf ~/.zshrc.pre-trey
mv ~/.zshrc ~/.zshrc.pre-trey
fi
# Install powerlevel10k oh-my-zsh prompt
POWERLEVEL10K_DIR=${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
if [ ! -d $POWERLEVEL10K_DIR ]; then
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $POWERLEVEL10K_DIR
fi
echo "Installing dotfiles..."
for d in ${dirs[@]}; do
stow $d
done