-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·728 lines (592 loc) · 22.1 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
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
#!/usr/bin/env bash
DEFAULT_HOSTNAME="Macbook"
success() {
echo -e "\e[1;32m$1\e[0m"
}
info() {
echo -e "\e[1;34m$1\e[0m"
}
warning() {
echo -e "\e[1;33m$1\e[0m"
}
error() {
echo -e "\e[1;31m$1\e[0m"
}
read -e -p "$(success '💻 Enter host name: ')" -i "${DEFAULT_HOSTNAME}" HOSTNAME
read -e -p "$(success '💻 Enter computer name: ')" -i "${DEFAULT_HOSTNAME}" COMPUTER_NAME
read -e -p "$(success '💻 Enter local host name: ')" -i "${DEFAULT_HOSTNAME}" LOCAL_HOSTNAME
read -e -p "$(success '📧 Enter your email: ')" USER_EMAIL
read -e -p "$(success '👤 Enter your nickname: ')" USERNAME
read -e -p "$(success '👤 Enter your full name: ')" FULL_NAME
ask() {
while true; do
read -p "$(success "$1 (y/n)?") " yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
*) error "Please answer y/Y or n/N" ;;
esac
done
}
if ask "Have you just turned on your new Macbook (literally, just right now)"; then
warning "You have to use your Macbook for a while to make it produce enough entropy for generating strong random numbers"
else
if ask "🔑 Do you want to generate SSH keys"; then
read -e -p "$(success 'Please, specify the type of key (RSA or ED25519): ')" -i "RSA" SSH_KEY_TYPE
case $SSH_KEY_TYPE in
1 | rsa | RSA)
success "🔑 Generating SSH keys (RSA with 4096 bits and 150 rounds of KDF)..."
ssh-keygen -t rsa -b 4096 -o -a 150 -C "${USER_EMAIL}" -f ~/.ssh/id_rsa
;;
2 | ed | ed25519 | ED25519)
success "🔑 Generating SSH keys (Ed25519 with 150 rounds of KDF)..."
ssh-keygen -t ed25519 -o -a 150 -C "${USER_EMAIL}" -f ~/.ssh/id_ed25519
;;
*)
warning "Unknown key type. Skipping generation of keys..."
;;
esac
else
warning "Skipping generation of SSH keys..."
fi
fi
if ! command -v xcode-select &>/dev/null; then
success "⚙️ Installing Xcode command line tools..."
xcode-select --install
xcode-select --version
fi
if ! command -v brew &>/dev/null; then
success "🍺 Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
success "🍺 Homebrew: tap caskroom/versions..."
brew tap caskroom/versions
success "🍺 Homebrew: tap homebrew/cask-versions..."
brew tap homebrew/cask-versions
if ask "🍺 Do you want to install Cakebrew"; then
brew install --cask cakebrew
fi
brew --version
fi
if ask "Do you want to install command-line interface for App Store"; then
success "Installing mas..."
brew install mas
if ask "Do you want to install Microsoft To Do"; then
success "⚙️ Installing Microsoft To Do..."
mas install 1274495053
fi
if ask "Do you want to install Magnet"; then
success "⚙️ Installing Magnet..."
mas install 441258766
fi
fi
if ask "Does your Macbook has notch?"; then
if ask "Do you want to install TopNotch?"; then
success "⚙️ Installing TopNotch..."
brew install --cask topnotch
fi
if ask "Do you want to install Bartender?"; then
success "⚙️ Installing Bartender..."
brew install --cask bartender
fi
fi
if ask "Do you have external display?"; then
brew install --cask monitorcontrol
fi
if ask "Do you want to install web browsers"; then
if ask "Do you want to install Mozilla Firefox"; then
success "🦊 Installing Mozilla Firefox..."
brew install --cask firefox
fi
if ask "Do you want to install Brave Browser"; then
success "🦁 Installing Brave Browser..."
brew install --cask brave-browser
fi
else
warning "Skipping installation of browsers..."
fi
if ask "Do you want to install communication apps"; then
if ask "Do you want to install Slack"; then
success "⚙️ Installing Slack..."
brew install --cask slack
fi
if ask "Do you want to install Telegram"; then
success "⚙️ Installing Telegram..."
brew install --cask telegram
fi
if ask "Do you want to install Discord"; then
success "⚙️ Installing Discord..."
brew install --cask discord
fi
if ask "Do you want to install Signal"; then
success "⚙️ Installing Signal..."
brew install --cask signal
fi
fi
if ask "Do you want to install iTerm2"; then
success "💻 Installing iTerm2..."
brew install --cask iterm2
success "💻 Installing Open In Terminal"
brew install --cask openinterminal
fi
if ask "Do you want to install AppCleaner"; then
success "⚙️ Installing AppCleaner..."
brew install --cask appcleaner
fi
if ask "Do you want to install VLC"; then
success "⚙️ Installing VLC..."
brew install --cask vlc
fi
if ask "Do you want to install Spotify"; then
success "⚙️ Installing Spotify..."
brew install --cask spotify
fi
if ask "Do you want to install Dropbox"; then
success "☁️ Installing Dropbox..."
brew install --cask dropbox
fi
if ask "Do you want to install Dash"; then
success "📚 Installing Dash..."
brew install --cask dash
fi
if ask "Do you want to install Visual Studio Code"; then
success "⚙️ Installing Visual Studio Code..."
brew install --cask visual-studio-code
fi
if ask "Do you want to install DB management tools"; then
if ask "Do you want to install DB Browser for SQLite"; then
success "⚙️ Installing DB Browser for SQLite"
brew install --cask db-browser-for-sqlite
fi
fi
if ask "Do you want to install Git"; then
success "⚙️ Installing Git..."
brew install git
git --version
if ask "Do you want to Git extensions (git-flow git-extras git-lfs)"; then
success "⚙️ Installing Git extensions..."
brew install git-flow git-extras git-lfs
fi
success "⚙️ Installing GitHub CLI..."
brew install hub
if ask "Do you want to configure Git"; then
success "⚙️ Configuring Git..."
git config --global user.name "${FULL_NAME}"
git config --global user.email "${USER_EMAIL}"
if ask "How about GPG signing of commits"; then
git config --global commit.gpgsign true
read -e -p "$(success 'Enter your GPG fingerprint: ')" GPG_FINGERPRINT
read -e -p "$(success 'Confirm your GPG fingerprint: ')" GPG_FINGERPRINT_CONFIRMATION
if [[ $GPG_FINGERPRINT ]]; then
if [[ "${GPG_FINGERPRINT}" == "${GPG_FINGERPRINT_CONFIRMATION}" ]]; then
git config --global user.signingkey "${GPG_FINGERPRINT}"
else
error "GPG fingerprints does not match. Skipping..."
fi
else
warning "Configuring GPG signing for Git has been skipped..."
fi
fi
fi
if ask "How about aliases for Git"; then
git config --global alias.unstage "reset HEAD --"
git config --global alias.last "log -1 HEAD"
git config --global alias.ci "commit"
git config --global alias.cia "commit --amend"
git config --global alias.cim "commit -m"
git config --global alias.cis "commit -S"
git config --global alias.civ "commit -v"
git config --global alias.co "checkout"
git config --global alias.cp "cherry-pick"
git config --global alias.d "diff"
git config --global alias.newb "checkout -b"
git config --global alias.r "remote"
git config --global alias.rv "remote -v"
git config --global alias.rb "rebase"
git config --global alias.tree "log --graph --oneline --all"
git config --global alias.undo "reset --mixed HEAD^"
fi
if ask "Do you want to install Sourcetree"; then
success "🌳 Installing Sourcetree"
brew install --cask sourcetree
fi
else
warning "Skipping installation of git..."
fi
if ask "❤️ Do you want to install the GNU software collection?"; then
# See: https://www.gnu.org/software/coreutils/
if ask "Do you want to install GNU coreutils"; then
success "⚙️ Installing GNU coreutils..."
brew install --force-bottle coreutils
else
warning "Skipping installation of GNU coreutils..."
fi
# See: https://www.gnu.org/software/diffutils/
if ask "Do you want to install GNU diffutils"; then
success "⚙️ Installing GNU diffutils..."
brew install --force-bottle diffutils
else
warning "Skipping installation of GNU diffutils..."
fi
# See: https://savannah.gnu.org/projects/which/
if ask "Do you want to install GNU which"; then
success "⚙️ Installing GNU which..."
brew install gnu-which --with-default-names
else
warning "Skipping installation of GNU which..."
fi
# See: https://www.gnu.org/software/sed/
if ask "Do you want to install GNU sed"; then
success "⚙️ Installing GNU sed..."
brew install gnu-sed --with-default-names
else
warning "Skipping installation of GNU sed..."
fi
# See: https://www.gnu.org/software/findutils/
if ask "🔍 Do you want to install GNU findutils"; then
success "🔍 Installing GNU findutils (find, locate, updatedb, and xargs)..."
brew install --force-bottle findutils --with-default-names
else
warning "Skipping installation of findutils..."
fi
# See: https://www.gnu.org/software/indent/
if ask "Do you want to install GNU Indent"; then
success "⚙️ Installing GNU Indent..."
brew install gnu-indent
else
warning "Skipping installation of GNU indent..."
fi
# See: https://www.gnu.org/software/grep/
if ask "🔍 Do you want to install GNU grep"; then
success "🔍 Installing GNU grep..."
brew install grep --with-default-names
else
warning "Skipping installation of GNU grep..."
fi
fi
if ask "🗜 Do you want to install compression/decompression tools"; then
success "🗜 Installing The Unarchiver..."
brew install --cask the-unarchiver
success "🗜 Install GNU tar..."
brew install gnu-tar --with-default-names
success "🗜 Installing unrar, xz and gzip..."
brew install unrar xz gzip
else
warning "Skipping installation of compression/decompression tools..."
fi
if ask "💡 Do you want to install various programming languages"; then
if ask "🐍 Do you want to install Python 3"; then
success "🐍 Installing Python..."
brew install [email protected] ipython pyenv
python --version
pyenv --version
fi
if ask "🦀 Do you want to install Rust"; then
success "🦀 Installing Rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
rustup default stable
rustup update
rustc --version
fi
if ask "Do you want to install Golang"; then
success "⚙️ Installing Golang..."
brew install golang
fi
if ask "Do you want to install Erlang"; then
success "⚙️ Installing Erlang..."
brew install erlang rebar3
fi
if ask "🧪 Do you want to install Elixir"; then
success "🧪 Installing Elixir..."
brew install elixir
iex --version
fi
if ask "☕️️ Do you want to install Java"; then
success "☕️️ Installing Java..."
brew install --cask java
java --version
if ask "Do you want to install Clojure"; then
success "⚙️ Installing Clojure..."
brew install clojure/tools/clojure leiningen
fi
fi
else
warning "Skipping installation of programming languages..."
fi
if ask "Do you want to install cryptocurrencies-related software"; then
success "⚙️ Installing Binance..."
brew install --cask binance
if ask "Do you have Ledger"; then
success "⚙️ Installing Ledger Live..."
brew install --cask ledger-live
fi
fi
if ask "Do you want to install fonts"; then
success "🍺 Homebrew: tap caskroom/fonts..."
brew tap caskroom/fonts
brew tap homebrew/cask-fonts
brew update
success "⚙️ Installing fonts..."
fonts=(
font-input
font-hasklig
font-fira-code
font-hack-nerd-font
font-anonymous-pro
font-inconsolidata
)
brew install --cask "${fonts[@]}"
fi
if ask "🛡 Do you want to install privacy and security software"; then
if ask "Do you want to install Tor Browser"; then
brew install --cask tor-browser
fi
if ask "🔒 Do you want to install GPG Suite"; then
success "🔒 Installing GPG Suite..."
brew install --cask gpg-suite
fi
if ask "Do you want to install OpenSSH"; then
success "🔒 Installing OpenSSH..."
brew install openssh
fi
if ask "Do you want to install OpenSSL"; then
success "🔒 Installing OpenSSL..."
brew install openssl
fi
if ask "Do you want to install 1Password"; then
success "⚙️ Installing 1Password..."
brew install --cask 1password
fi
else
warning "Skipping installation of privacy and security software..."
fi
if ask "🛠 Do you want to install JetBrain's IDEs"; then
if ask "Will you install them manually, using JetBrain Toolbox"; then
success "⚙️ Installing JetBrains Toolbox..."
brew install --cask jetbrains-toolbox
else
if ask "🛠 Do you want to install PyCharm"; then
success "⚙️ Installing PyCharm Professional..."
brew install --cask pycharm
fi
if ask "🛠 Do you want to install WebStorm"; then
success "⚙️ Installing WebStorm..."
brew install --cask webstorm
fi
if ask "🛠 Do you want to install GoLand"; then
success "⚙️ Installing GoLand..."
brew install --cask goland
fi
if ask "🛠 Do you want to install CLion"; then
success "⚙️ Installing CLion..."
brew install --cask clion
fi
if ask "🛠 Do you want to install RubyMine"; then
success "⚙️ Installing RubyMine..."
brew install --cask rubymine
fi
if ask "🛠 Do you want to install DataGrip"; then
success "⚙️ Installing DataGrip..."
brew install --cask datagrip
fi
if ask "🛠 Do you want to IntelliJ IDEA Ultimate"; then
success "⚙️ Installing IntelliJ IDEA Ultimate..."
brew install --cask intellij-idea
fi
fi
fi
if ask "🔬 Do you want to install network/traffic analysis tools"; then
success "🔬 Installing network/traffic analysis tools"
utils=(
mtr
tmux
ngrok
hping
telnet
tcpdump
tcpflow
tcptrace
tcpreplay
prettyping
)
for package in "${utils[@]}"; do
success "⚙️ Installing ${package}..."
brew install "${package}"
done
if ask "Do you want to install Wireshark"; then
success "⚙️ Installing Wireshark..."
brew install --cask wireshark
fi
fi
if ask "🛠 Do you want to install toolset for frontend development"; then
success "🛠 Installing Node and TypeScript..."
brew install nvm node typescript deno
fi
if ask "🛠 Do you want to other CLI-tools"; then
success "🛠 Installing misc developer CLI-tools..."
dev_utils=(
jq
fzf
bat
wget
tree
trash
tokei
rename
httpie
neovim
ffmpeg
libjpeg
gettext
readline
hadolint
automake
readline
hyperfine
shellcheck
screenfetch
)
for package in "${dev_utils[@]}"; do
success "⚙️ Installing ${package}..."
brew install "${package}"
done
fi
if ask "🐠 Do you want to install fish"; then
success "🐠 Installing fish..."
brew install fish
success "🐠 Setting up fish as default..."
chsh -s /usr/local/bin/fish
success "🐠 Installing oh-my-fish..."
curl -L https://get.oh-my.fish | fish
success "🐠 Changing theme..."
omf theme idan
else
warning "Skipping installation of fish..."
fi
brew cleanup
if ask "Do you want to change the default settings of your macOS"; then
success "💻 Changing macOS's settings..."
success "Avoid appearing your name in local networks and in various preference files..."
sudo scutil --set ComputerName "${COMPUTER_NAME}"
sudo scutil --set HostName "${HOSTNAME}"
sudo scutil --set LocalHostName "${LOCAL_HOSTNAME}"
success "Sleep the display after 10 minutes..."
sudo pmset -a displaysleep 10
success "Disable machine sleep while charging..."
sudo pmset -c sleep 0
success "Set machine sleep to 5 minutes on battery..."
sudo pmset -b sleep 5
# Disable shit I hate.
defaults write com.apple.dashboard mcx-disabled -boolean YES
# This line deactivates rubber scrolling:
defaults write -g NSScrollViewRubberbanding -int 0
success "Scrollbars visible when scrolling"
defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling"
success "Maximize windows on double clicking them"
defaults write -g AppleActionOnDoubleClick 'Maximize'
success "🕵️♀️Improving privacy..."
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Don’t send search queries to Apple
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
# Improve security
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles -bool false
success "Improving stuff..."
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
# Show the full URL in the address bar (note: this still hides the scheme)
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
# Set Safari’s home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string "about:blank"
# Disable Safari’s thumbnail cache for History and Top Sites
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Disable AutoFill
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
defaults write com.apple.Safari AutoFillPasswords -bool false
defaults write com.apple.Safari AutoFillCreditCardData -bool false
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false
# Enable “Do Not Track”
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
# Update extensions automatically
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
# Show Finder path bar:
defaults write com.apple.finder ShowPathbar -bool true
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Disable autocorrect:
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Disable auto-capitalization:
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
# Notification dismiss timeout:
defaults write com.apple.notificationcenterui bannerTime -int 4
# Turn on app auto-update
defaults write com.apple.commerce AutoUpdate -bool true
# Automatically download apps purchased on other Macs
defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1
# Download newly available updates in background
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
# Auto-play videos when opened with QuickTime Player
defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true
# Sort Activity Monitor results by CPU usage
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Don’t display the annoying prompt when quitting iTerm
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
# Don’t show recent applications in Dock
defaults write com.apple.dock show-recents -bool false
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.1
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
# Show the ~/Library folder
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Empty Trash securely by default
defaults write com.apple.finder EmptyTrashSecurely -bool true
# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Save screenshots in PNG format
defaults write com.apple.screencapture type -string "png"
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Disable crash reporter
defaults write com.apple.CrashReporter DialogType none
# Don't save documents to iCloud by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
killall Finder
killall Dock
fi
success '✨ Done!'