forked from fharper/macsetup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macsetup.sh
executable file
·2946 lines (2578 loc) · 56.9 KB
/
macsetup.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
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env zsh
###################################################################################################
# #
# Notes #
# #
# - to erase correctly previous laptop disk, use the command: "diskutil secureErase 4 /dev/disk0" #
# #
###################################################################################################
#########################
# #
# Script Configurations #
# #
#########################
email="hi@fred.dev"
function notification {
terminal-notifier -message "$1"
read -pr 'Press enter to continue'
}
function pausethescript {
echo "Press ENTER to continue the installation script"
read -r
}
function openfilewithregex {
local file=$(find . -maxdepth 1 -execdir echo {} ';' | grep "$1")
open "${file}"
pausethescript
rm "${file}"
}
function installkeg {
chalk blue "Starting the installation of $1"
local alreadyInstalled=$(brew list "$1" 2>&1 | grep "No such keg")
if [[ -n "$alreadyInstalled" ]]; then
brew install "$1"
else
chalk red "Nothing to do, $1 is already installed"
fi
}
function installcask {
chalk blue "Starting the installation of $1"
local alreadyInstalled=$(brew list "$1" 2>&1 | grep "No such keg")
if [[ -n "$alreadyInstalled" ]]; then
brew install --cask $1
else
chalk red "Nothing to do, $1 is already installed"
fi
}
function getAppFullPath {
mdfind -name 'kMDItemFSName=="'"$1"'.app"' -onlyin /Applications -onlyin /System/Applications
}
function isAppInstalled {
local app=$(getAppFullPath "$1")
if [[ -n "$app" ]]; then
echo true
else
echo false
fi
}
function isCLAppInstalled {
local cli=$(which "$1" | grep "not found")
if [[ -z "$cli" ]]; then
echo true
else
echo false
fi
}
function installPythonPackage {
chalk blue "Installing the Python package $1"
local package=$(pip list | grep "$1")
if [[ -n "$package" ]]; then
chalk red "$1 is already installed"
else
pip install "$1"
fi
}
function restoreAppSettings {
echo "[applications_to_sync]\n$1" > /Users/fharper/.mackup.cfg
mackup restore
echo "" > /Users/fharper/.mackup.cfg
}
#
# Install the application from a DMG image when you just need to move the
# application into the macOS Applications folder
#
# @param DMG filename
#
function installDMG {
hdiutil attach "$1"
local volume="/Volumes/$(hdiutil info | grep /Volumes/ | sed 's@.*\/Volumes/@@')"
local app=$(/bin/ls "$volume" | grep .app)
mv "$volume/$app" /Applications
hdiutil detach "/Volumes/$volume"
rm "$1"
}
function reload {
source ~/.zshrc
}
#
# Create a csreq blob for a specific application
#
# @param app name
#
# @return csreq blob in hexadecimal
#
# Notes:
# - Process taken from https://stackoverflow.com/a/57259004/895232
#
function getCsreqBlob {
local app=$(getAppFullPath "$1")
# Get the requirement string from codesign
local req_str=$(codesign -d -r- "$app" 2>&1 | awk -F ' => ' '/designated/{print $2}')
echo "$req_str" | csreq -r- -b /tmp/csreq.bin
local hex_blob=$(xxd -p /tmp/csreq.bin | tr -d '\n')
rm /tmp/csreq.bin
echo "$hex_blob"
}
#
# Get the application bundle identifier
#
# @param app name
#
# @return the application bundle identifier
#
function getAppBundleIdentifier {
local app=$(getAppFullPath "$1")
mdls -name kMDItemCFBundleIdentifier -r "$app"
}
#
# Give Full Disk Access Permission for a specific application
#
# @param app name
#
function giveFullDiskAccessPermission {
updateTCC "kTCCServiceSystemPolicyAllFiles" "$1"
}
#
# Give Screen Recording Permission for a specific application
#
# @param app name
#
function giveScreenRecordingPermission {
updateTCC "kTCCServiceScreenCapture" "$1"
}
#
# Give Accessibility Permission for a specific application
#
# @param app name
#
function giveAccessibilityPermission {
updateTCC "kTCCServiceAccessibility" "$1"
}
#
# Update the access table in the TCC database with the new permission
#
# @param service for permission
# @param application identifier
# @param application csreq blob
#
# Notes:
# - More information on TCC at https://www.rainforestqa.com/blog/macos-tcc-db-deep-dive
#
function updateTCC {
local app_identifier=$(getAppBundleIdentifier "$2")
local app_csreq_blob=$(getCsreqBlob "$2")
# Columns:
# - service: the service for the permission (ex.: kTCCServiceSystemPolicyAllFiles for Full Disk Access permission)
# - client: app bundle identifier
# - client_type: 0 since it's the bundle identifier
# - auth_value: 2 for allowed
# - auth_reason: 3 user set
# - auth_version: always 1 for now
# - csreq: binary code signing requirement blob that the client must satisfy in order for access to be granted
# - policy_id: null, related to MDM
# - indirect_object_identifier_type: 0 since it's the bundle identifier
# - indirect_object_identifier: UNUSED since it's not needed for this permission
# - indirect_object_code_identity: same as csreq policy_id, so NULL
# - flags: not sure, always 0
# - last_modifified: last time entry was modified
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "insert into access values('$1', '$app_identifier', 0, 2, 3, 1, '$app_csreq_blob', NULL, 0, 'UNUSED', NULL, 0, CAST(strftime('%s','now') AS INTEGER));"
}
#
# Get the license key from 1Password & copy it to the clipboard
#
# @param the application we want the license key
#
function getLicense {
op item get "$1" --fields label="license key" | pbcopy
notification "Add the license key from the clipboard to $1"
}
#######################
# #
# Pre-Installalations #
# #
#######################
#
# Restore different files with Mackup (not app specifics)
#
restoreAppSettings files
#
# Rosetta2
#
# Run x86_64 app on arm64 chip
#
# https://developer.apple.com/documentation/apple_silicon/about_the_rosetta_translation_environment
#
if [[ -z $(pgrep oahd) ]]; then
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
fi
#
# iTerm2
# iTerm2 Shell Integration
#
# Terminal replacement
#
# https://github.com/gnachman/iTerm2
# https://iterm2.com/documentation-shell-integration.html
#
if [[ ! $(isAppInstalled iTerm) ]]; then
installcask iterm2
giveFullDiskAccessPermission iTerm
curl -L https://iterm2.com/shell_integration/install_shell_integration.sh | bash
open -a iTerm
exit
fi
#
# Oh My Zsh
#
# https://github.com/ohmyzsh/ohmyzsh
#
if [[ ! $(isCLAppInstalled omz) ]]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
#
# Antigen
#
# ZSH plugin manager
#
# https://github.com/zsh-users/antigen
#
installkeg antigen
#
# DisplayLink Manager & DisplayLink Manager MacOS Extension
#
# Add the possibility to have more than one external monitor on MacBook M1 with a DisplayLink compatible hub
# Extension for DisplayLink Manager to work at the login screen
#
# https://www.displaylink.com
#
installcask displaylink
installcask displaylink-login-extension
############################
# #
# Utils to run this script #
# (needed order) #
# #
############################
#
# Xcode Command Line Tools
#
# Command line XCode tools & the macOS SDK frameworks and headers
#
# https://developer.apple.com/xcode
#
if [[ $(xcode-select -p 1> /dev/null; echo $?) -eq 2 ]]; then
xcode-select --install
fi
#
# Homebrew + homebrew-cask-versions + brew-cask-upgrade + Casks for Fonts
#
# macOS package manager
# Alternate versions of Homebrew Casks
# CLI for upgrading outdated Homebrew Casks
# Casks for Fonts
#
# https://github.com/Homebrew/brew
# https://github.com/Homebrew/homebrew-cask-versions
# https://github.com/buo/homebrew-cask-upgrade
# https://github.com/Homebrew/homebrew-cask-fonts
#
if [[ ! $(isCLAppInstalled brew) ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew analytics off
brew tap homebrew/cask-versions
brew tap buo/cask-upgrade
brew tap homebrew/cask-fonts
brew tap OJFord/formulae
brew tap homebrew/cask-drivers
fi
#
# Mackup
#
# Sync applications settings with Dropbox
#
# https://github.com/lra/mackup
#
# Notes: needed right after Homebrew so configurations files can be restored
#
installkeg mackup
#
# Miniforge + Python + Wheel + Pylint + pytest + Twine
#
# Python virtual environment manager
# Python SDK
# Python wheel packaging tool
# Python linter
# Python tests framework
# Utilities for interacting with PyPI
#
# https://github.com/conda-forge/miniforge
# https://www.python.org
# https://github.com/pypa/wheel
# https://github.com/PyCQA/pylint/
# https://github.com/pytest-dev/pytest
# https://github.com/pypa/twine/
#
if [[ ! $(isCLAppInstalled conda) ]]; then
installcask miniforge
conda activate base
conda install python=3.10.6
installPythonPackage wheel
installPythonPackage pylint
installPythonPackage pytest
installPythonPackage twine
fi
#
# mas-cli
#
# Unofficial macOS App Store CLI
#
# https://github.com/mas-cli/mas
#
# Notes: Need to install before Xcode
#
if [[ ! $(isCLAppInstalled mas) ]]; then
installkeg mas
open -a "App Store"
notification "Sign in into the App Store"
pausethescript
fi
#
# Xcode
#
# macOS/iOS Swift/Ojective-C IDE
#
# https://developer.apple.com/xcode
#
# Notes: need to install before defbro
#
if [[ ! $(isAppInstalled Xcode) ]]; then
mas install 497799835
sudo xcodebuild -license accept
restoreAppSettings Xcode
fi
#
# defbro
#
# CLI to change the default browser
#
# https://github.com/jwbargsten/defbro
#
installkeg jwbargsten/misc/defbro
#
# Dockutil
#
# Utility to manage macOS Dock items
#
# https://github.com/kcrawford/dockutil
#
installkeg dockutil
#
# Duti
#
# Utility to set default applications for document types (file extensions)
#
# https://github.com/moretension/duti
#
installkeg duti
#
# Git
#
# File versioning
#
# https://github.com/git/git
#
installkeg git
#
# jq
#
# https://github.com/stedolan/jq
#
# Needed for my "git clone" function
#
installkeg jq
#
# lastversion
#
# CLI to get latest GitHub Repo Release assets URL
#
# https://github.com/dvershinin/lastversion
#
installPythonPackage lastversion
#
# loginitems
#
# Utility to manage startup applications
#
# https://github.com/ojford/loginitems
#
installkeg loginitems
#
# mysides
#
# Finder sidebar tool
#
# https://github.com/mosen/mysides
#
installcask mysides
#
# nvm + Node.js + npm cli
#
# https://github.com/nvm-sh/nvm
# https://github.com/nodejs/node
# https://github.com/npm/cli
#
if [[ -n $(brew list "$1" 2>&1 | grep "No such keg") ]]; then
installkeg nvm
reload
#mkdir ~/.nvm
nvm install v18.0.0
nvm use v18.0.0
npm i -g npm@latest
npm adduser
fi
#
# OpenSSL
#
# TLS/SSL and crypto library
#
# https://github.com/openssl/openssl
#
installkeg openssl
#
# BZip2
#
# Data compressor
#
# https://sourceware.org/bzip2/
#
installkeg BZip2
#
# osXiconUtils
#
# Utilities for working with macOS icons
#
# https://github.com/sveinbjornt/osxiconutils
#
if [[ ! $(isCLAppInstalled geticon) ]]; then
curl -L https://sveinbjorn.org/files/software/osxiconutils.zip --output osxiconutils.zip
unzip osxiconutils.zip
rm osxiconutils.zip
sudo chown fharper:admin /usr/local/bin
mv bin/geticon /usr/local/bin/
mv bin/seticon /usr/local/bin/
rm -rf bin/
fi
#
# tccutil
#
# Command line tool to modify the accessibility database
#
# https://github.com/jacobsalmela/tccutil
#
installkeg tccutil
#
# Script Editor
#
sudo -E tccutil -e com.apple.ScriptEditor2
#
# terminal-notifier
#
# Utility to send macOS notifications
#
# https://github.com/julienXX/terminal-notifier
#
installkeg terminal-notifier
###########################
# #
# Top Helper Applications #
# #
###########################
notification "Deactivate the System Integrity Protection with 'csrutil disable' in Recovery Mode"
#
# Alfred & alfred-google-translate & alfred-language-configuration
#
# Spotlight replacement
#
# https://www.alfredapp.com
#
installcask alfred
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 64 "<dict><key>enabled</key><false/><key>value</key><dict><key>parameters</key><array><integer>65535</integer><integer>49</integer><integer>1048576</integer></array><key>type</key><string>standard</string></dict></dict>" # Deactivate Spotlight Global Shortcut to use it with Alfred instead (will work after logging off)
getLicense Alfred
sudo -E tccutil -e com.runningwithcrayons.Alfred
npm install -g alfred-google-translate
npm install -g alfred-language-configuration
notification "Configure alfred-google-translate with 'trc en&fr'"
#
# Bartender
#
# macOS menubar manager
#
# https://www.macbartender.com
#
installcask bartender
sudo -E tccutil -e com.surteesstudios.Bartender
#
# CleanShot X
#
# Screenshot utility
#
# https://cleanshot.com
#
installcask cleanshot
notification "install the audio component in Preferences >> Recording >> Audio Recording"
#
# CommandQ
#
# Utility to prevent accidentally quiting an application
#
# https://commandqapp.com
#
installcask commandq
#
# Contexts
#
# Application windows switcher
#
# https://contexts.co
#
installcask contexts
sudo -E tccutil -e com.contextsformac.Contexts
notification "Open the license file from 1Password"
#
# Control Plane
#
# Utility to automate things based on context & location
#
# https://github.com/dustinrue/ControlPlane
#
installcask controlplane
#
# Dropbox
#
# File sharing & computer backup
#
# https://www.dropbox.com
#
installcask dropbox
#
# Espanso
#
# Text expander / snipet
#
# https://github.com/federico-terzi/espanso
#
brew tap federico-terzi/espanso
installkeg espanso
sudo tccutil -e "$(print -r =espanso\(:A\))"
restoreAppSettings espanso
espanso register
espanso start
#
# HSTR
#
# Shell command history management
#
# https://github.com/dvorka/hstr
#
installkeg hh
#
# Karabiner-Elements
#
# Keyboard customization utility
#
# https://github.com/pqrs-org/Karabiner-Elements
#
installcask karabiner-elements
#
# KeepingYouAwake
#
# Menubar app to manage caffeinate
#
# https://github.com/newmarcel/KeepingYouAwake
#
installcask keepingyouawake
#
# Little Snitch
#
# Kinda dynamic firewall
#
# https://www.obdev.at/products/littlesnitch/index.html
#
installcask little-snitch
#
# MailTrackerBlocker
#
# Email tracker, read receipt and spy pixel blocker plugin for Apple Mail
#
# https://github.com/apparition47/MailTrackerBlocker
#
installkeg mailtrackerblocker
#
# Logitech Mouse Manager
#
# Mouse Configuration
#
# https://www.logitech.com/en-ca/product/options
#
curl -L https://download01.logi.com/web/ftp/pub/techsupport/options/options_installer.zip --output logitech.zip
unzip logitech.zip
rm logitech.zip
openfilewithregex "LogiMgr Installer.*"
rm -rf "${file}"
#
# Moom
#
# Applications' windows management
#
# https://manytricks.com/moom
#
# install the App Store version since you bought it there
#
mas install 419330170
#
# Shush
#
# Easily mute or unmute your microphone
#
# https://mizage.com/shush/
#
mas install 496437906
#
# Sound Control
#
# Advanced audio controls
#
# https://staticz.com/soundcontrol/
#
installcask sound-control
#
# The Clock
#
# macOS Clock replacement with more advance features like work clocks & time zones
#
# https://www.seense.com/the_clock/
#
# Notes
# - You cannot remove the clock from the menubar anymore: minimizing used space as analog
#
defaults write com.apple.menuextra.clock IsAnalog -bool true
installcask the-clock
getLicense "The Clock"
#
# tmux
#
# Running multiple terminal sessions in the same window
#
# https://github.com/tmux/tmux
#
installkeg tmux
#
# TripMode
#
# Manage applications internet access
#
# https://tripmode.ch
#
installcask TripMode
#
# Zoom
#
# Video conference
#
# https://zoom.us
#
installcask zoomus
#
# Zsh-z
#
# fastest cd alternative
#
# https://github.com/agkozak/zsh-z
#
git clone git@github.com:agkozak/zsh-z.git "$ZSH_CUSTOM"/plugins/zsh-z
########################
# #
# Applications Cleanup #
# #
########################
#
# Garage Band
#
sudo rm -rf /Applications/GarageBand.app
#
# iMovie
#
sudo rm -rf /Applications/iMovie.app
#
# Keynote
#
sudo rm -rf /Applications/Keynote.app
#
# Numbers
#
sudo rm -rf /Applications/Numbers.app
#
# Pages
#
sudo rm -rf /Applications/Pages.app
################
# #
# Dock Cleanup #
# #
################
#
# App Store
#
dockutil --remove 'App Store' --allhomes
#
# Calendar
#
dockutil --remove 'Calendar' --allhomes
#
# Contacts
#
dockutil --remove 'Contacts' --allhomes
#
# Facetime
#
dockutil --remove 'FaceTime' --allhomes
#
# Launchpad
#
dockutil --remove 'Launchpad' --allhomes
#
# Maps
#
dockutil --remove 'Maps' --allhomes
#
# Music
#
dockutil --remove 'Music' --allhomes
#
# News
#
dockutil --remove 'News' --allhomes
#
# Notes
#
dockutil --remove 'Notes' --allhomes
#
# Podcasts
#
dockutil --remove 'Podcasts' --allhomes
#
# Reminders
#
dockutil --remove 'Reminders' --allhomes
#
# Safari
#
dockutil --remove 'Safari' --allhomes
#
# System Preferences
#
dockutil --remove 'System Preferences' --allhomes
#
# TV
#
dockutil --remove 'TV' --allhomes
###############################
# #
# Dock & Menu Bar Preferences #
# #
###############################
#
# Minimize window into application icon
#
defaults write com.apple.dock minimize-to-application -bool true
#
# Position on screen
#
defaults write com.apple.dock "orientation" -string "right"
#
# Show recent applications in Dock
#
defaults write com.apple.dock show-recents -bool false
#
# Tile Size
#
defaults write com.apple.dock tilesize -int 35
######################
# #
# Finder Preferences #
# #
######################
#
# .DS_Store files creation on Network Disk
#
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
#
# New Finder windows show
#
defaults write com.apple.finder NewWindowTarget -string "PfLo"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Downloads"
#
# Show all filename extensions
#
defaults write -g AppleShowAllExtensions -bool true
#
# Show Library Folder
#
xattr -d com.apple.FinderInfo ~/Library
sudo chflags nohidden ~/Library
#
# Show Path Bar
#
defaults write com.apple.finder ShowPathbar -bool true
#
# Show Status Bar
#
defaults write com.apple.finder ShowStatusBar -boolean true
#
# Show these items on the desktop - CDs, DVDs, and iPods
#
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
#
# Show these items on the desktop - External disks
#
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
#
# Sidebar Favorites Reordering
#
mysides remove all
mysides add Downloads file:///Users/fharper/Downloads
mysides add Documents file:///Users/fharper/Documents
mysides add Dropbox file:///Users/fharper/Dropbox
mysides add Applications file:///Applications/
###################
# #
# Mission Control #
# #
###################
#
# Hot Corners - Bottom Right (disable Note app)
#
defaults write com.apple.dock wvous-br-corner -int 0
##################################
# #
# Security & Privacy Preferences #
# #
##################################
#
# FileVault - Turn On Filevault...
#
sudo fdesetup enable
#
# General - Allow apps downloaded from Anywhere
#
sudo spctl --master-disable
##########################