forked from mgechev/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
109 lines (91 loc) · 3.44 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
OPTIONS="Linux MacOS Quit"
linux_bootstrap () {
echo "Executing Linux bootstrap"
echo "Installing ZSH and dependencies"
sudo apt-get update
sudo apt-get install -y zsh wget curl git autojump python3-pygments
echo "Installing Oh My Zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
#echo "Installing Spaceship theme"
#git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
#ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
echo "Installing Powerlevel10k theme"
git clone https://github.com/romkatv/powerlevel10k.git "$ZSH_CUSTOM/themes/powerlevel10k"
ln -s "$ZSH_CUSTOM/themes/powerlevel10k/powerlevel10k.zsh-theme" "$ZSH_CUSTOM/themes/powerlevel10k.zsh-theme"
echo "Removing older files"
rm -rf ~/.gemrc ~/.gitexcludes ~/.vimrc ~/.zshrc
echo "Linking new files to home"
for $dotfile in ./.*; do
local dotfileName=$(echo $dotfile | awk -F/ '{ print }')
echo "Linking $dotfileName to ~/$dotfileName"
ln $dotfile ~/$dotfileName
done
echo "Removing .bashrc and .gitconfig"
rm -rf ~/.bashrc ~/.gitconfig
echo "Linking .bashrc and .gitconfig to your home at $(echo ~)"
ln ./.bashrc ~/.bashrc
ln ./.gitconfig ~/.gitconfig
echo "Creating ZSH completions folder"
if [ ! -d "~/.zsh" ]; then
mkdir ~/.zsh
fi
if [ ! -d "~/.zsh/completions" ]; then
mkdir ~/zsh/completions
fi
echo "Linking completions file to ~/zsh/completions"
for file in ./zshCompletions/*; do
local fileName=$(echo $file | awk -F/ '{ print }')
echo "Linking $file to ~/.zsh/completions/$fileName"
ln $file ~/.zsh/completions/$fileName
done
echo "Downloading Fira Code font from NerdFonts"
curl https://github.com/ryanoasis/nerd-fonts/releases/download/v1.2.0/FiraCode.zip --create-dirs -o ~/.dotbootstrap/fira.zip
if [ ! -d "~/.fonts" ]; then
mkdir ~/.fonts
fi
cd ~/.fonts
unzip ~/.dotbootstrap/fira.zip
rm -rf ~/.dotbootstrap
sudo add-apt-repository universe
sudo apt-get install -y fonts-firacode
echo "Installing ZSH Plugins"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
clear
echo "Installing FZF, remember to aswer Y to all questions"
sleep 5
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install
clear
}
mac_bootstrap () {
echo "Executing Mac bootstrap"
}
show_completion_message () {
echo "Instalation completed"
echo "--- IMPORTANT MANUAL STEPS ---"
echo "1 - Change your terminal font to Fira Code Nerdfont"
echo "2 - Restart your terminal for changes to take effect"
echo "3 - Enter your Vim and run :PlugInstall to install all plug-ins"
echo "4 - Set ZSH_THEME=\"spaceship\" in your .zshrc."
echo "--------"
echo "IMPORTANT: DO NOT REMOVE THIS REPOSITORY FOLDER OR YOU'LL LOSE THE SYMLINKS TO THE DOTFILES"
}
echo "Which OS are you using?"
select opt in $OPTIONS; do
if [ "$opt" = "Quit" ]; then
echo "Bye!"
exit 0
elif [ "$opt" = "Linux" ]; then
linux_bootstrap
show_completion_message
exit
elif [ "$opt" = "MacOS" ]; then
mac_bootstrap
show_completion_message
exit
else
clear
echo "Bad option"
fi
done