-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli_install.sh
executable file
·365 lines (310 loc) · 7.07 KB
/
cli_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
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
#!/usr/bin/env bash
# Include required libraries
source ./std.sh
source ./pretty-print.sh
source ./install_helper.sh
### ENVIRONMENT DETECTION ###
txt_attr_name=$(txt_attr $FG_COLOR_LIGHT_GREEN)
print_title "Environment: $txt_attr_name $ENV_OS_NAME $ENV_OS_VERSION ($ENV_OS_BUILD_VERSION) | $ENV_ARCH_NAME""$reset_all\n"
### INSTALL ###
echo
print_title "Install and/or update Homebrew:\n"
brew_export_shell_environment
if command -v brew &> /dev/null; then
echo "Already installed, updating"
brew update;brew upgrade
else
echo "Not installed, installing"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
if brew_export_shell_environment && ! command -v brew &> /dev/null; then
echo "Brew not installed, aborting."
exit $EXIT_FAILURE
fi
fi
### NOGO APPS/TOOLS & WHY ###
# "atom" // Now using VSCode
# "brackets" // Now using VSCode
# "dash3" // No more available in repo
# "dozer" // Replaced by "Hidden Bar" from mas as this is not native Apple Silicon
# "flux" // Now using macOS Night Shift
# "jd-gui" // Unidentified developer (signature), no permission
# "openssh" // OpenSSH does not support 'UseKeychain' option introduced in macOS 10.12.2+
# // To use this version, add "IgnoreUnknown UseKeychain" in config file before using it.
# "realm-studio" // Deprecated legacy software since acquisition by MongoDB
# "slack" // Installed via mas
# "swiftlint" // Requires Xcode App
# "tftpserver" // No more available in repo
# "the-unarchiver" // Using mas
# "vagrant" // On demand
# "vagrant-manager" // Runs with Vagrant
# "warp" // Not yet usable (too early alpha stage)
echo
print_title "Install Shells:\n"
shells=(
"bash"
"bash-completion@2"
"zsh"
)
brew_batch_install shells[@]
echo
print_title "Install cli tools\n"
cli_tools=(
"autoconf"
"binutils"
"coreutils"
"ed"
"findutils"
"fzf"
"gawk"
"gnu-indent"
"gnu-sed"
"gnu-tar"
"gnu-which"
"gnupg"
"graphviz"
"grep"
"gzip"
"librsvg"
"mas"
"rsync"
"screen"
"tmux"
"tree"
"vitorgalvao/tiny-scripts/cask-repair"
"zoxide"
)
brew_batch_install cli_tools[@]
echo
print_title "Install developer cli tools\n"
developer_tools=(
"ack"
"android-commandlinetools"
"boost"
"carthage"
"chisel"
"cocoapods"
"composer"
"diff-so-fancy"
"dex2jar"
"diffutils"
"file-formula"
"gh"
"git"
"git-extras"
"git-lfs"
"git-quick-stats"
"gnutls"
"httpie"
"jq"
"mitmproxy"
"node"
"nvm"
"ocaml"
"openjdk"
"openjdk@11"
"openjdk@17"
"gradle"
"perl"
"python"
"ruby"
"svn"
"tig"
"vim"
"volta"
"watch"
"watchman"
"wdiff"
"wget"
"yarn"
)
brew_batch_install developer_tools[@]
echo
print_title "Update built-in macOS tools to last GNU version\n"
built_in_update=(
"emacs"
"gpatch"
"m4"
"make"
"nano"
)
brew_batch_install built_in_update[@]
echo
print_title "Update non-GNU commands\n"
non_gnu=(
"less"
)
brew_batch_install non_gnu[@]
echo
print_title "Install Image Tools\n"
image_tools=(
"fftw"
"graphicsmagick"
"imagemagick"
)
brew_batch_install image_tools[@]
echo
print_title "Install Applications (Cask)\n"
ui_apps=(
"android-studio"
"angry-ip-scanner"
"anydesk"
"appcleaner"
"asset-catalog-tinkerer"
"Bluesnooze"
"brave-browser"
"cakebrew"
"dbeaver-community"
"dbngin"
"figma"
"firefox"
"flixtools"
"fork"
"google-chrome"
"handbrake"
"iina"
"intellij-idea-ce"
"ios-app-signer"
"iterm2"
"keepingyouawake"
"keycastr"
"maccy"
"maciasl"
"monitorcontrol"
"notion"
"obsidian"
"opera"
"paw"
"pinentry-mac"
"proxyman"
"react-native-debugger"
"rectangle"
"sloth"
"signal"
"silentknight"
"sourcetree"
"spotify"
"transmission"
"typora"
"visual-studio-code"
"vlc"
"wwdc"
"xattred"
"zeplin"
)
brew_batch_install ui_apps[@]
echo
print_title "Install QuickLook Plugin (Cask)\n"
ql_plugins=(
"qlcolorcode"
"qlstephen"
"qlmarkdown"
"quicklook-json"
"provisionql"
"syntax-highlight"
"quicklookapk"
)
brew_batch_install ql_plugins[@]
echo
print_title "Install ScreenSavers (Cask)\n"
screensavers=(
"aerial"
)
brew_batch_install screensavers[@]
echo
print_title "Install Fonts (Cask)\n"
fonts=(
"homebrew/cask-fonts/font-menlo-for-powerline"
"homebrew/cask-fonts/font-roboto-mono-for-powerline"
)
brew_batch_install fonts[@]
echo
print_title "Install packages from 'Unidentified Developer' (Cask)\n"
echo "Requires open authorization in 'System Preferences > Security & Privacy > General'"
unidentified=(
"oclint"
)
brew_batch_install unidentified[@]
echo
print_title "Install Cask packages with user action required\n"
action_required=(
"microsoft-edge" # Requires Password
"sdformatter" # Requires Password
)
brew_batch_install action_required[@]
echo
print_title "Drivers and other Hardware apps (Cask)\n"
drivers=()
brew_batch_install drivers[@]
### ARCH TARGET APPS/TOOLS ###
echo
print_title "Install x86_64 arch tools & apps:\n"
arch_x86_64_only=(
"clementine"
"sequel-pro"
"sketch-toolbox"
"virtualbox" # Requires Password
"virtualbox-extension-pack"
"apktool"
"sonarqube" # Requires Java
"sonar-scanner" # Runs with sonarqube
"sonar-completion" # Runs with sonarqube
"homebrew/cask-drivers/logitech-options"
)
arch_rosetta_compat=(
"android-file-transfer"
"balenaetcher"
"caption"
"charles"
"deezer"
"gas-mask"
"geektool"
"imageoptim"
"impactor"
"macdown"
"openemu"
"opensim"
"pusher"
)
if [ "$ENV_ARCH_NAME" == "$ENV_ARCH_X86_64" ]; then
echo
print_title "Install x86_64 arch tools & apps:\n"
brew_batch_install arch_x86_64_only[@]
# If arch is emulated
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo
print_title "Install Rosetta apps:\n"
brew_batch_install arch_rosetta_compat[@]
fi
fi
# Registering different Java versions, v18 available but not yet supported by some tools like Gradle
echo
print_title "Java Virtual Machines registration (Version 11, 17)\n"
JAVA_PATH_11=$(brew --prefix openjdk@11 2> /dev/null)
JAVA_PATH_17=$(brew --prefix openjdk@17 2> /dev/null)
JVM_HOME="/Library/Java/JavaVirtualMachines"
JDK_NAME="openjdk.jdk"
[[ -d "$JAVA_PATH_11" ]] && sudo ln -sfn "$JAVA_PATH_11/libexec/$JDK_NAME" "$JVM_HOME/[email protected]"
[[ -d "$JAVA_PATH_17" ]] && sudo ln -sfn "$JAVA_PATH_17/libexec/$JDK_NAME" "$JVM_HOME/[email protected]"
echo
print_title "Cleanup\n"
brew cleanup -s
rm -rf $(brew --cache)
echo
print_title "Brew packages installation DONE!\n"
echo
print_title "Dotfiles installation\n"
dotfiles_symlink "home_files"
echo
print_title "Bash Powerline installation\n"
# Zsh is default shell in macOS 10.15+
# Needs bash_profile under bash
bash;source ~/.bash_profile
pip install --user powerline-gitstatus
pip install --user powerline-status
echo
print_title "Update user default Shell (Requires Password):\n"
add_acceptable_shell `command -v bash` default
add_acceptable_shell `command -v zsh`
echo
print_title "Install Mac AppStore Apps\n"
./mas_installer.sh