-
Notifications
You must be signed in to change notification settings - Fork 0
/
machine_fresh_install.bash
executable file
·117 lines (82 loc) · 2.45 KB
/
machine_fresh_install.bash
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
110
111
112
113
114
115
116
117
#!/usr/bin/env bash
# Script to install all the required programs and configurations for
# a fresh Mac
set -o nounset
set -o errexit
user=$(whoami)
main() {
create_resources
install_programs
plugins_setup
zsh_setup
prepare_dotfiles
echo "---------------------------------------------------------------"
echo "---------------------------------------------------------------"
echo "Follow the instructions in Readme to complete the setup"
echo "---------------------------------------------------------------"
echo "---------------------------------------------------------------"
exit 0
}
create_resources() {
DIRS=(
"$HOME/.vim/undo"
"$HOME/.vim/bundle"
"$HOME/.vim/swap"
"$HOME/personal"
"$HOME/work"
"$HOME/projects"
)
for dirname in "${DIRS[@]}"; do
sudo mkdir -p "$dirname"
done
touch "$HOME/.private_work_aliases"
sudo chmod 777 -R ~/.vim/undo ~/.vim/swap
echo "Directories created"
}
prepare_dotfiles() {
rm -rf ~/buds-dotfiles
git clone --single-branch [email protected]:budmc29/buds-dotfiles.git ~/buds-dotfiles
rm -rf ~/buds-dotfiles/.git
cp -r ~/buds-dotfiles/ ~/ && sudo rm -rf ~/.git
echo "Dotfiles added"
}
install_tmux() {
brew install tmux
}
install_programs() {
install_tmux
install_fonts
brew install ag
brew install wget
}
install_fonts() {
wget https://github.com/adobe-fonts/source-code-pro/releases/download/2.042R-u%2F1.062R-i%2F1.026R-vf/OTF-source-code-pro-2.042R-u_1.062R-i.zip
unzip OTF-source-code-pro-2.042R-u_1.062R-i.zip
mkdir -p ~/.fonts
sudo cp OTF/*.otf ~/Library/Fonts
rm -rf OTF*
# Install San Francisco font system wide
wget https://github.com/supermarin/YosemiteSanFranciscoFont/archive/master.zip
unzip master.zip
rm master.zip*
# Move to system fonts
mv Yo*/*.ttf ~/Library/Fonts
rm -rf Yo*
echo "Fonts installed"
}
zsh_setup() {
rm -rf /home/$user/.oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
echo "Oh My Zsh installed"
}
plugins_setup() {
# Vundle plugin manager for vim
sudo git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# Tmux plugins
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
chmod -R 777 ~/.tmux
# Vim plugins
sudo vim +PluginInstall +qall
}
main "$@"