-
Notifications
You must be signed in to change notification settings - Fork 0
/
osx.sh
270 lines (192 loc) Β· 12.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
echo "πππ Setting up your Mac..."
echo ""
# Close open System Preferences panes, to prevent them from overriding settings.
osascript -e 'tell application "System Preferences" to quit'
###############################################################################
# WindowManager #
###############################################################################
echo "π WindowManager: Enable Standard Click to Show Desktop"
defaults write com.apple.WindowManager EnableStandardClickToShowDesktop -bool false
###############################################################################
# Dock #
###############################################################################
echo "π Dock: Clear"
defaults write com.apple.dock persistent-apps -array
echo "π Dock: Set the icon size of items to 50 pixels"
defaults write com.apple.dock tilesize -int 50
echo "π Dock: Donβt animate opening applications"
defaults write com.apple.dock launchanim -bool false
echo "π Dock: Automatically hide and show"
defaults write com.apple.dock autohide -bool true
echo "π Dock: Donβt show recent applications"
defaults write com.apple.dock show-recents -bool false
echo "π Dock: Speed up Mission Control animations"
defaults write com.apple.dock expose-animation-duration -float 0.1
echo "π Dock: Donβt automatically rearrange Spaces based on most recent use"
defaults write com.apple.dock mru-spaces -bool false
###############################################################################
# Input #
###############################################################################
echo "π Input: Disable auto-correct"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
echo "π Input: Disable automatic capitalization as itβs annoying when typing code"
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
echo "π Input: Disable smart dashes as theyβre annoying when typing code"
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
echo "π Input: Disable automatic period substitution as itβs annoying when typing code"
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
echo "π Input: Disable smart quotes as theyβre annoying when typing code"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
echo "π Input: Enable full keyboard access for all controls"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
echo "π Input: Disable press-and-hold for keys in favor of key repeat"
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
echo "π Input: Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
###############################################################################
# Login Window #
###############################################################################
echo "π LoginWindow: Show language menu in the top right corner of the boot screen"
sudo -n defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
###############################################################################
# Energy #
###############################################################################
echo "π Energy: Disable machine sleep while charging"
sudo -n pmset -c sleep 0
###############################################################################
# Screen #
###############################################################################
echo "π Screen: 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 "π Screen: Save screenshots to the desktop"
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
echo "π Screen: Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)"
defaults write com.apple.screencapture type -string "png"
echo "π Screen: Enable subpixel font rendering on non-Apple LCDs"
# Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
defaults write NSGlobalDomain AppleFontSmoothing -int 1
echo "π Screen: Enable HiDPI display modes (requires restart)"
sudo -n defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
###############################################################################
# Finder #
###############################################################################
echo "π Finder: Set sidebar icon size to medium"
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
echo "π Finder: Expand save panel by default"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
echo "π Finder: Expand print panel by default"
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
echo "π Finder: Save to disk (not to iCloud) by default"
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
echo "π PrintingPrefs: Automatically quit printer app once the print jobs complete"
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
echo "π LaunchServices: Disable the βAre you sure you want to open this application?β dialog"
defaults write com.apple.LaunchServices LSQuarantine -bool false
echo "π Finder: disable window animations and Get Info animations"
defaults write com.apple.finder DisableAllAnimations -bool true
echo "π Finder: Set Desktop as the default location for new Finder windows"
defaults write com.apple.finder NewWindowTarget -string "PfHm"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
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 "π Finder: Hide tags in sidebar"
defaults write com.apple.finder ShowRecentTags -bool false
echo "π Finder: Set search scope"
# This Mac : `SCev`
# Current Folder : `SCcf`
# Previous Scope : `SCsp`
defaults write com.apple.finder FXDefaultSearchScope SCcf
echo "π Finder: Set preferred view style"
# Icon View : `icnv`
# List View : `Nlsv`
# Column View : `clmv`
# Cover Flow : `Flwv`
defaults write com.apple.finder FXPreferredViewStyle Nlsv
rm -rf ~/.DS_Store
echo "π Finder: Display full POSIX path as Finder window title"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
echo "π Finder: Keep folders on top when sorting by name"
defaults write com.apple.finder _FXSortFoldersFirst -bool true
echo "π Finder: When performing a search, search the current folder by default"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
echo "π Finder: Disable the warning when changing a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
echo "π Finder: Enable spring loading for directories"
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
echo "π Finder: Remove the spring loading delay for directories"
defaults write NSGlobalDomain com.apple.springing.delay -float 2
echo "π Finder: Avoid creating .DS_Store files on network or USB volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Disable disk image verification
# defaults write com.apple.frameworks.diskimages skip-verify -bool true
# defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
# defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# Automatically open a new Finder window when a volume is mounted
# defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
# defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
# defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
###############################################################################
# TextEdit #
###############################################################################
echo "π TextEdit: Use plain text mode for new TextEdit documents."
defaults write com.apple.TextEdit RichText -int 0
echo "π TextEdit: Open and save files as UTF-8 in TextEdit."
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
echo "π NetworkBrowser: Enable AirDrop over Ethernet and on unsupported Macs running Lion"
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
echo "π Terminal: Only use UTF-8"
defaults write com.apple.terminal StringEncodings -array 4
echo "π Terminal: Enable Secure Keyboard Entry"
# See: https://security.stackexchange.com/a/47786/8918
defaults write com.apple.terminal SecureKeyboardEntry -bool true
###############################################################################
# Activity Monitor #
###############################################################################
echo "π ActivityMonitor: Show the main window when launching"
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
echo "π ActivityMonitor: Visualize CPU usage in the Dock icon"
defaults write com.apple.ActivityMonitor IconType -int 5
echo "π ActivityMonitor: Show all processes"
defaults write com.apple.ActivityMonitor ShowCategory -int 0
echo "π ActivityMonitor: Sort results by CPU usage"
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
###############################################################################
# Mac App Store #
###############################################################################
echo "π AppStore: Enable the WebKit Developer Tools"
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
echo "π AppStore: Enable Debug Menu"
defaults write com.apple.appstore ShowDebugMenu -bool true
echo "π AppStore: Enable the automatic update check"
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
echo "π AppStore: Check for software updates daily, not just once per week"
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
echo "π AppStore: Download newly available updates in background"
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
echo "π AppStore: Install System data files & security updates"
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
echo "π AppStore: Turn on app auto-update"
defaults write com.apple.commerce AutoUpdate -bool true
echo "π AppStore: Allow the App Store to reboot machine on macOS updates"
defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
###############################################################################
# Messages #
###############################################################################
echo "π Messages: Disable smart quotes as itβs annoying for messages that contain code"
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
echo "π Messages: Disable continuous spell checking"
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
killall WindowManager
killall Dock
killall Finder