-
Notifications
You must be signed in to change notification settings - Fork 0
/
osx.sh
executable file
·370 lines (344 loc) · 24.3 KB
/
osx.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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
#!/bin/bash
#################################################################################################################################################
## osx.sh ##
## Author: Siddharth Rawat ##
## Copyright 2024 sydrawat01/dotfiles ##
#################################################################################################################################################
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
echo "| |"
echo "| INSTALL SCRIPT v3.0 |"
echo "| |"
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
start=$(date +%s)
USER=$(whoami)
sleep 2
# Install cmd line tools IF not installed
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
echo "| |"
echo "| Setting up XCode tools |"
echo "| |"
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
xcode-select -p 1>/dev/null
XCODE=$?
if [ $XCODE -eq 0 ]; then
printf '⏭ Command line developer tools are already installed.\nSkipping...\n\n'
else
printf ' 📦 Installing XCode command line developer tools...\nThis may take a while.\n'
xcode-select --install
INSTALL=$?
if [ $INSTALL -eq 0 ]; then
printf '✨ XCode developer tools installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing XCode developer tools.\n'
fi
fi
# Install homebrew IF not installed
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
echo "| |"
echo "| Installing homebrew |"
echo "| |"
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
BREW=$(which brew)
BREW=$?
if [ $BREW -eq 0 ]; then
printf '⏭ Homebrew is already installed.\nSkipping...\n\n'
else
printf '📦 Installing homebrew...\n'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
BREW=$?
if [ $BREW -eq 0 ]; then
printf '✨ Homebrew installed successfully!\n'
printf '⚙️ Configuring homebrew on your Mac...\n'
echo '# Set PATH, MANPATH, etc. for Homebrew.' >>/Users/"$USER"/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>/Users/"$USER"/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
source /Users/"$USER"/.zprofile
BREW="$(brew -v)"
BREW=$?
if [ $BREW -eq 0 ]; then
printf "⚙️ Updating homebrew...\nThis may take a while.\n"
brew update
printf '✔ Done.\n'
else
printf '💩 Oops! Could not find the binaries linked to Homebrew. Try restaring your terminal.\n'
fi
else
printf '💩 Oops! Something went wrong while installing Homebrew.\n'
fi
fi
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
echo "| |"
echo "| Basic Softwares |"
echo "| |"
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Firefox Developer Ed. |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Firefox Developer Edition...\n'
brew install --cask firefox-developer-edition
FIREFOX=$?
if [ $FIREFOX -eq 0 ]; then
printf '✨ Firefox Developer Edition installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Firefox Developer Edition.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Google Chrome Canary |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Google Chrome Canary Edition...\n'
brew install --cask google-chrome-canary
CHROME=$?
if [ $CHROME -eq 0 ]; then
printf '✨ Google Chrome Developer Edition installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Google Chrome Developer Edition.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Brave Browser Beta |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Brave Browser Beta...\n'
brew install --cask brave-browser-beta
BRAVE=$?
if [ $BRAVE -eq 0 ]; then
printf '✨ Brave Browser Beta installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Brave Browser Beta.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| iTerm2 |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing iTerm2...\n'
brew install --cask iterm2
ITERM=$?
if [ $ITERM -eq 0 ]; then
printf '✨ iTerm2 installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing iTerm2.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Nerd Fonts |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing JetBrains Mono Nerd font...\n'
brew tap homebrew/cask-fonts
brew install --cask font-jetbrains-mono-nerd-font
JBM=$?
if [ $JBM -eq 0 ]; then
printf '✨ JetBrains Mono Nerd font installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing JetBrains Mono Nerd font.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| tmux |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing tmux...\n'
brew install tmux
TMUX=$?
if [ $TMUX -eq 0 ]; then
printf '✨ tmux installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing tmux.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Starship |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Starship...\n'
brew install starship
SHIP=$?
if [ $SHIP -eq 0 ]; then
printf '✨ Starship installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Starship.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| neovim |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing neovim...\n'
brew install neovim
NVIM=$?
if [ $NVIM -eq 0 ]; then
printf '✨ neovim installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing neovim.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| GNU Stow |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing GNU Stow...\n'
brew install stow
NVIM=$?
if [ $NVIM -eq 0 ]; then
printf '✨ GNU Stow installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing GNU Stow.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Postman |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Postman...\n'
brew install --cask postman
POSTMAN=$?
if [ $POSTMAN -eq 0 ]; then
printf '✨ Postman installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Postman.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| VSCode |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing VSCode...\n'
brew install --cask visual-studio-code
VSC=$?
if [ $VSC -eq 0 ]; then
printf '✨ VSCode installed successfully!\n'
printf "⚙️ Configuring VSCode...\n."
cat ./configs/vscode/extensions.txt | xargs -L 1 code --install-extension
VSC=$?
if [ $VSC -eq 0 ]; then
printf '✔ Done.\n'
else
printf '💩 Oops! Something went wrong while installing VSCode extensions.\n'
fi
else
printf '💩 Oops! Something went wrong while installing VSCode.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Oh-My-Zsh |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing oh-my-zsh...\n'
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
OMZ=$?
if [ $OMZ -eq 0 ]; then
printf '✨ oh-my-zsh installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing oh-my-zsh.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Slack |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Slack...\n'
brew install --cask slack
SLACK=$?
if [ $SLACK -eq 0 ]; then
printf '✨ Slack installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Slack.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Zoom |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Zoom...\n'
brew install --cask zoom
ZOOM=$?
if [ $ZOOM -eq 0 ]; then
printf '✨ Zoom installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Zoom.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Bitwarden |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Bitwarden...\n'
brew install --cask bitwarden
BIT=$?
if [ $BIT -eq 0 ]; then
printf '✨ Bitwarden installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Bitwarden.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| OneDrive |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing OneDrive...\n'
brew install --cask onedrive
OND=$?
if [ $OND -eq 0 ]; then
printf '✨ OneDrive installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing OneDrive.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| Logi Options + |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
printf '📦 Installing Logi Options +...\n'
brew install --cask logi-options-plus
LOP=$?
if [ $LOP -eq 0 ]; then
printf '✨ Logi Options + installed successfully!\n'
else
printf '💩 Oops! Something went wrong while installing Logi Options +.\n'
fi
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# echo "| |"
# echo "| NVM, NodeJS & NPM |"
# echo "| |"
# echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
# printf '📦 Installing Node Version Manager...\n'
# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
# NVM=$?
# if [ $NVM -eq 0 ]; then
# printf '✨ Node Version Manager installed successfully!\n'
# source ~/.zshrc
# NVM=$(command -v nvm)
# NVM=$?
# if [ $NVM -eq 0 ]; then
# printf '📦 Installing LTS version of NodeJS...\n'
# nvm install --lts
# printf "⚙️ Configuring NodeJS...\n."
# nvm use --lts
# echo "node $(node --version)"
# echo "npm $(npm --version)"
# printf '✔ Done.\n'
# else
# printf '💩 Oops! Could not find the binaries linked to NVM. Try restarting your terminal.\n'
# fi
# else
# printf '💩 Oops! Something went wrong while installing Node Version Manager.\n'
# fi
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
echo "| |"
echo "| Performing Homebrew Cleanup |"
echo "| |"
echo "+-----------------------------------------------------------------------------------------------------------------------------------------+"
brew cleanup --prune=all
BRWCLNP=$?
if [ $BRWCLNP -eq 0 ]; then
printf '✔ Cleanup complete.\n'
else
printf '❌ Error occurred while performing brew cleanup\n'
fi
runtime=$((($(date +%s) - start) / 60))
printf 'Setup completed in %s minutes\n' "$runtime"