forked from hexalellogram/mac-setup
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SystemSettings.sh
executable file
·346 lines (252 loc) · 14.8 KB
/
SystemSettings.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
#!/bin/bash
# Inspired by https://github.com/mathiasbynens/dotfiles/blob/master/.macos
echo "Beginning macOS Settings configuration"
echo "Gaining administrator privileges (these will be kept until the script is finished)"
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo "Expanded save panel by default"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
echo "Expanded print panel by default"
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
echo "Save to disk by default"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
echo "Automatically quit printer app once print jobs complete"
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
echo "Reveal IP address, hostname, OS version, etc. when clicking the clock in the login window"
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
echo "Restart automatically if the computer freezes"
sudo systemsetup -setrestartfreeze on
echo "Enable tap to click for this user and for the login screen"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
echo "Disable \"natural\" scrolling"
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
echo "Increase sound quality for Bluetooth headphones/headsets"
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
echo "Set language and text formats"
defaults write NSGlobalDomain AppleLanguages -array "en" "nl"
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=USD"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Inches"
defaults write NSGlobalDomain AppleMetricUnits -bool false
echo "Show language menu in the top right corner of the boot screen"
sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
echo "Set timezone"
sudo systemsetup -settimezone "America/Los_Angeles" > /dev/null
echo "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
echo "Save screenshots to ~/Temp"
defaults write com.apple.screencapture location -string "${HOME}/Temp"
echo "Save screenshots in PNG format"
defaults write com.apple.screencapture type -string "png"
echo "Disable shadow in screenshots"
defaults write com.apple.screencapture disable-shadow -bool true
echo "Set ~/Temp as the default location for new Finder windows"
defaults write com.apple.finder NewWindowTarget -string "PfLo"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Temp/"
echo "Show icons for servers and removable media on the desktop"
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
echo "Don't show internal hard drives on the desktop"
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
echo "Finder: show all filename extensions"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
echo "Finder: show status bar"
defaults write com.apple.finder ShowStatusBar -bool true
echo "Finder: show path bar"
defaults write com.apple.finder ShowPathbar -bool true
echo "Display full path as Finder window title"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
echo "Keep folders on top when sorting by name"
defaults write com.apple.finder _FXSortFoldersFirst -bool true
echo "Use column view in all Finder windows by default"
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
echo "Show the ~/Library folder"
chflags nohidden ~/Library
echo "Expand the following File Info panes: \"General\", \"Open with\", and \"Sharing & Permissions\""
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
echo "Show indicator lights for open applications in the Dock"
defaults write com.apple.dock show-process-indicators -bool true
echo "Disable Dashboard"
defaults write com.apple.dashboard mcx-disabled -bool true
echo "Don’t show Dashboard as a Space"
defaults write com.apple.dock dashboard-in-overlay -bool true
echo "Don’t automatically rearrange Spaces based on most recent use"
defaults write com.apple.dock mru-spaces -bool false
echo "Automatically hide and show the Dock"
defaults write com.apple.dock autohide -bool true
echo "Copy email addresses as \`[email protected]\` instead of \`Foo Bar <[email protected]>\` in Mail.app"
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
echo "Disable inline attachments (just show the icons)"
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
echo "Prevent Time Machine from prompting to use new hard drives as backup volume"
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
echo "Enable the automatic update check"
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
echo "Check for software updates daily, not just once per week"
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
echo "Download newly available updates in background"
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
echo "Install System data files & security updates"
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
echo "Turn on app auto-update"
defaults write com.apple.commerce AutoUpdate -bool true
echo "Allow the App Store to reboot machine on macOS updates"
defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
echo "Prevent Photos from opening automatically when devices are plugged in"
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
echo "Transmission: Don’t prompt for confirmation before downloading"
defaults write org.m0k.transmission DownloadAsk -bool false
defaults write org.m0k.transmission MagnetOpenAsk -bool false
echo "Transmission: Don’t prompt for confirmation before removing non-downloading active transfers"
defaults write org.m0k.transmission CheckRemoveDownloading -bool true
echo "Transmission: Trash original torrent files"
defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
echo "Transmission: Hide the donate message"
defaults write org.m0k.transmission WarningDonate -bool false
echo "Transmission: Hide the legal disclaimer"
defaults write org.m0k.transmission WarningLegal -bool false
echo "Transmission: IP block list"
# Source: https://giuliomac.wordpress.com/2014/02/19/best-blocklist-for-transmission/
defaults write org.m0k.transmission BlocklistNew -bool true
defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz"
defaults write org.m0k.transmission BlocklistAutoUpdate -bool true
echo "Adding 3 spacers to the dock"
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="small-spacer-tile";}'
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="small-spacer-tile";}'
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="small-spacer-tile";}'
echo "Remove Dock Show and Hide Delay"
defaults write com.apple.Dock autohide-delay -float 0
echo "Installing San Francisco Pro Display, Pro Text, and Mono Fonts for User Use"
# SF Mono
cp /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/* ~/Library/Fonts/
# SF Pro Display and Pro Text
curl -LOk https://developer.apple.com/fonts/downloads/SFPro.zip
unzip -a SFPro.zip
rm SFPro.zip
cd SFPro
sudo installer -pkg San\ Francisco\ Pro.pkg -target /
cd ..
echo "Terminal Profile"
open Pro Modified.terminal
defaults write com.apple.Terminal "Default Window Settings" -string "Pro Modified"
defaults write com.apple.Terminal "Startup Window Settings" -string "Pro Modified"
echo "Show Debug Menu in App Store"
defaults write com.apple.appstore ShowDebugMenu -bool true
echo "Show Debug Menu in Contacts"
defaults write com.apple.addressbook ABShowDebugMenu -bool true
echo "Enable Develop Menu & Web Inspector in Safari"
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true && \
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 && \
defaults write -g WebKitDeveloperExtras -bool true
echo "Use Backspace/Delete to Return to the Previous Page in Safari"
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
echo "Enable 'Focus Follows Mouse' in Terminal & All X11 Apps"
defaults write com.apple.Terminal FocusFollowsMouse -bool true
defaults write org.x.X11 wm_ffm -bool true
echo "Fix VSCodeVim Key Repeat in Microsoft Visual Studio Code"
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
echo "Disabling Creation of Metadata Files on Network Volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
echo "Disabling Creation of Metadata Files on USB Volumes"
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
echo "Enable Full Keyboard Access for All Controls (Enable Tab in Modal Dialogs)"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
echo "Enable Snap-to-Grid for Icons"
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
echo "Disable Safari's Thumbnail Cache for History & Top Sites"
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
echo "Make Safari’s search banners default to Contains instead of Starts With"
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
echo "Add a Context Menu Item Show Web Inspector in Web Views"
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
echo "Enable Continuous Spellchecking"
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true
echo "Enable Auto-Correction"
defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false
echo "Warn About Fraudulent Websites"
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
echo "Block Pop-Up Windows"
defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false
echo "Disable Auto-Playing Videos"
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
echo "Enable Do Not Track"
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
echo "Enable Auto-Updating of Safari Extensions"
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
echo "Display E-mails in Threaded Mode, Sorted Descending by Date Received"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
echo "Enable Spell-Checking in Mail"
defaults write com.apple.mail SpellCheckingBehavior -string "SpellCheckingEnabled"
echo "Disable Automatic Line Marking in Terminal"
defaults write com.apple.Terminal ShowLineMarks -int 0
echo "Prevent Time Machine from Automatically Prompting to Use New External Hard Drives as a Backup Volume"
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
echo "Show the main window when launching Activity Monitor"
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
echo "Visualize CPU usage in the Activity Monitor Dock icon"
defaults write com.apple.ActivityMonitor IconType -int 5
echo "Show all processes in Activity Monitor"
defaults write com.apple.ActivityMonitor ShowCategory -int 0
echo "Sort Activity Monitor results by CPU usage"
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
echo "Enable the Debug Menu in Disk Utility"
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
echo "Enable the WebKit Developer Tools in the Mac App Store"
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
echo "Enable Debug Menu in the Mac App Store"
defaults write com.apple.appstore ShowDebugMenu -bool true
echo "Enable the automatic update check"
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
echo "Download newly available updates in background"
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
echo "Turn on app auto-update"
defaults write com.apple.commerce AutoUpdate -bool true
echo "Prevent Photos from opening automatically when devices are plugged in"
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
echo "Use the system-native print preview dialog"
defaults write com.google.Chrome DisablePrintPreview -bool true
defaults write com.google.Chrome.canary DisablePrintPreview -bool true
echo "Expand the print dialog by default"
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true
echo "Killing affected apps"
for app in "Activity Monitor" \
"Address Book" \
"App Store" \
"Calendar" \
"cfprefsd" \
"Contacts" \
"Dock" \
"Finder" \
"Google Chrome" \
"Mail" \
"Messages" \
"Photos" \
"Safari" \
"SystemUIServer" \
"Transmission" \
"Visual Studio Code" \
"iCal"; do
killall "${app}" &> /dev/null
done
echo "Done. Note that some of these changes require a logout/restart to take effect."
echo "Terminal must be restarted manually for the Terminal profile settings to work."