-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-mac.sh
executable file
·233 lines (196 loc) · 4.74 KB
/
prepare-mac.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
function help {
echo "\nUsage"
echo "h - help"
echo "c - complete installation"
echo "q - quit\n"
echo "1 - homebrew"
echo "2 - tools"
echo "3 - terminal"
echo "4 - shell"
echo "5 - languages"
echo "6 - development tools"
echo "7 - virtualization tools"
echo "8 - communication tools"
echo "9 - media tools"
echo "10 - repo [gunasekar/shell]"
echo "11 - customize_mpv"
echo "12 - customise_ytdl"
echo "13 - add_bitbar_plugins"
echo "14 - add_vim_color_schemes"
echo "-> Mac AppStore Applications - Monosnap, CopyClip"
}
function prep_brew {
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
}
function install_brew {
for i in $*; do
if ! brew list $i &>/dev/null; then
echo "Installing $i"
brew install $i
else
echo "$i already installed"
fi
done
}
function install_brew_cask {
for i in $*; do
if ! brew list --cask $i &>/dev/null; then
echo "Installing $i"
brew install --cask $i
else
echo "$i already installed"
fi
done
}
##### tools
function prep_tools {
install_brew wget ranger oath-toolkit jq
install_brew_cask google-chrome itsycal bitbar
}
##### terminals
function prep_terminal {
install_brew_cask iterm2
}
##### shell
function prep_shell {
install_brew zsh zsh-completions
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
}
##### languages
function prep_languages {
install_brew go protobuf node python
}
##### development tools
function prep_dev_tools {
# CLIs
install_brew mycli pgcli bitwarden-cli awscli
# P Tools
install_brew wget oath-toolkit jq nmap textql gist tig graphviz fzf
# Shell tools
install_brew htop ranger watch tree
# CASK - Editors
install_brew_cask atom sublime-text visual-studio-code
# CASK - UI tools
install_brew_cask sequel-ace dbeaver-community postman fork boost-note
}
function prep_docker {
install_brew docker-compose kubectl
install_brew_cask docker
}
##### communication
function prep_communication {
install_brew_cask slack skype
}
##### media
function prep_media_tools {
install_brew youtube-dl mpv
}
##### clone the required repos under $HOME/setup
function prep_repo {
git clone https://github.com/gunasekar/shell.git $HOME/setup/shell
}
##### customize mpv
function customize_mpv {
mkdir -p $HOME/.config/mpv
ln -sf ~/setup/shell/conf/mpv.conf ~/.config/mpv/mpv.conf
}
##### customize youtube-dl
function customize_ytdl {
mkdir -p $HOME/.config
touch ~/.config/youtube-dl.conf
echo "--output \"$HOME/Downloads/media/video/%(title)s.%(ext)s\"" >> ~/.config/youtube-dl.conf
}
##### add bitbar-plugins
function add_bitbar_plugins {
mkdir -p $HOME/.bitbar-plugins
for plugin in "$HOME/setup/shell/bitbar-plugins/"*
do
fileName=$(basename $plugin)
echo $fileName
ln -sf $plugin "$HOME/.bitbar-plugins/$fileName"
done
}
##### add vim color schemes
function setup_vim {
mkdir -p $HOME/.vim/colors
for colorscheme in "$HOME/setup/shell/vim/colors/"*
do
fileName=$(basename $colorscheme)
echo $fileName
ln -sf $colorscheme "$HOME/.vim/colors/$fileName"
done
}
help
echo "\nSelect your action: "
read action
while [ "$action" != "q" ]
do
case "$action" in
h)
help
;;
c)
prep_brew
prep_tools
prep_terminal
prep_shell
prep_languages
prep_dev_tools
prep_docker
prep_communication
prep_media_tools
prep_repo
customize_mpv
customize_ytdl
add_bitbar_plugins
;;
1)
prep_brew
;;
2)
prep_tools
;;
3)
prep_terminal
;;
4)
prep_shell
;;
5)
prep_languages
;;
6)
prep_dev_tools
;;
7)
prep_docker
;;
8)
prep_communication
;;
9)
prep_media_tools
;;
10)
prep_repo
;;
11)
customize_mpv
;;
12)
customize_ytdl
;;
13)
add_bitbar_plugins
;;
14)
add_vim_color_schemes
;;
*)
echo '\033[31mInvalid Input \033[0m'
;;
esac
help
echo "\nSelect your action: "
read action
done