-
Notifications
You must be signed in to change notification settings - Fork 3
/
macos
executable file
·395 lines (286 loc) · 18 KB
/
macos
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
# My very minimal use of Mathias Bynens OS X defaults, with a couple of my own added
# http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Menu bar: show battery percentage
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
# Set sidebar icon size to Small
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable the Time Machine new disk requests dialog
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Disable window animation
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Developer CrashReport dialog type
defaults write com.apple.CrashReporter DialogType developer
# Reduce transparency
defaults write com.apple.universalaccess reduceTransparency -boolean true
###############################################################################
# Trackpad, mouse, keyboard, and input #
###############################################################################
# Don't automatically switch to a Space with open windows for and application when switching to it
defaults write com.apple.dock workspaces-auto-swoosh -boolean NO
# Don’t automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
# Trackpad: 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
# Trackpad: swipe between pages with three fingers
defaults write NSGlobalDomain AppleEnableSwipeNavigateWithScrolls -bool true
defaults -currentHost write NSGlobalDomain com.apple.trackpad.threeFingerHorizSwipeGesture -int 1
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerHorizSwipeGesture -int 1
# Trackpad: Enable other gestures
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerVertSwipeGesture -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadFourFingerVertSwipeGesture -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadFourFingerPinchGesture -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadFourFingerHorizSwipeGesture -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadFiveFingerPinchGesture -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerTapGesture -int 2
# Trackpad & Mouse: High tracking speed
defaults write NSGlobalDomain com.apple.mouse.scaling 3.0
defaults write NSGlobalDomain com.apple.trackpad.scaling 3.0
# Trackpad: Disable force click
defaults write NSGlobalDomain com.apple.trackpad.forceClick -bool false
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Use scroll gesture with the Ctrl (^) modifier key to zoom
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Enable the "Do Not Disturb On/Off" keyboard shortcut
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 175 "{
enabled = 0;
value = {
parameters = (
65535,
53,
262144
);
type = standard;
};
}"
###############################################################################
# Screen Saver #
###############################################################################
# Require password 15 minutes after sleep or screen saver begins
defaults write com.apple.screensaver askForPasswordDelay -int 900
###############################################################################
# Finder #
###############################################################################
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Set home 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}/"
# Finder: show hidden files by default
defaults write com.apple.Finder AppleShowAllFiles -bool true
# Finder: set window title to full POSIX file path of current folder
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# 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
# 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
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Increase grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 70" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 70" ~/Library/Preferences/com.apple.finder.plist
# Increase the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 40" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 40" ~/Library/Preferences/com.apple.finder.plist
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Don't show drives on Desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# Collapse tags in sidebar
defaults write com.apple.finder SidebarTagsSctionDisclosedState -int 0
# Show the ~/Library folder
chflags nohidden ~/Library
###############################################################################
# Dock, Launchpad & hot corners #
###############################################################################
# Set the icon size of Dock items to 30 pixels
defaults write com.apple.dock tilesize -int 50
# Don’t show Dashboard as a Space
defaults write com.apple.dock "dashboard-in-overlay" -bool true
# Position Dock on right of screen
defaults write com.apple.dock orientation -string right
# Remove the auto-hiding Dock delay
defaults write com.apple.Dock autohide-delay -float 0
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Enable gestures
defaults write com.apple.dock showMissionControlGestureEnabled -bool true
defaults write com.apple.dock showAppExposeGestureEnabled -bool true
defaults write com.apple.dock showDesktopGestureEnabled -bool true
defaults write com.apple.dock showLaunchpadGestureEnabled -bool true
# Hot corners
# Bottom right screen corner → Put Display to Sleep
defaults write com.apple.dock wvous-br-corner -int 10
defaults write com.apple.dock wvous-br-modifier -int 0
# Remove recent apps section from the dock
defaults write com.apple.Dock show-recents -bool true
###############################################################################
# Safari & WebKit #
###############################################################################
# Set Safari’s home page to nothing
defaults write com.apple.Safari HomePage -string ""
# Restore last session at launch
defaults write com.apple.Safari AlwaysRestoreSessionAtLaunch -bool true
defaults write com.apple.Safari OpenPrivateWindowWhenNotRestoringSessionAtLaunch -bool false
# Hide Safari’s bookmarks bar by default
defaults write com.apple.Safari ShowFavoritesBar -bool false
# 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
# Remove useless icons from Safari’s bookmarks bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
# 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
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Prevent Safari from opening "safe" files automatically after downloading
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
# Don’t allow websites to ask for permission to send push notifications
defaults write com.apple.Safari CanPromptForPushNotifications -bool false
# Show overlay status bar
defaults write com.apple.Safari ShowOverlayStatusBar -bool true
###############################################################################
# iTunes, Mail, and Disk Utility #
###############################################################################
# Disable radio stations in iTunes
defaults write com.apple.iTunes disableRadio -bool true
# Copy email addresses as `foo@example.com` instead of `Foo Bar <foo@example.com>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Enable the debug menu in Disk Utility
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
###############################################################################
# Quicktime X #
###############################################################################
# Enable autoplay
defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen 1
###############################################################################
# Terminal #
###############################################################################
# Disable automatically marking prompt lines
defaults write com.apple.Terminal AutoMarkPromptLines -int 0
# Set default window settings
defaults write com.apple.Terminal "Default Window Settings" -string "Homebrew"
defaults write com.apple.Terminal "Startup Window Settings" -string "Homebrew"
###############################################################################
# Calendar #
###############################################################################
# Show sidebar
defaults write com.apple.iCal CalendarSidebarShown -bool true
###############################################################################
# Messages #
###############################################################################
# Disable emoji text substitution
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
###############################################################################
# Activity Monitor #
###############################################################################
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
###############################################################################
# MacVim #
###############################################################################
# Always show hidden files
defaults write org.vim.MacVim AppleShowAllFiles -bool true
###############################################################################
# TextEdit #
###############################################################################
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# 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
###############################################################################
# Photos #
###############################################################################
# Prevent Photos from opening automatically when devices are plugged in
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
###############################################################################
# TweetBot #
###############################################################################
# Open URLs in Background
defaults write com.tapbots.Tweetbot3Mac openURLInBackground -int 1
# Only play notification sounds
defaults write com.tapbots.Tweetbot3Mac soundType -int 1
# Snow small image thumbnails
defaults write com.tapbots.Tweetbot3Mac statusViewImageType -int 1
###############################################################################
# SourceTree #
###############################################################################
# Use Compact View in the Repository Browser
defaults write com.torusknot.SourceTreeNotMAS bookmarksStyleSize -int 1
# Show whitespace in the diff view
defaults write com.torusknot.SourceTreeNotMAS diffIgnoreWhitespace -int 0
# Set double-click to stage file instead of opening in editor
defaults write com.torusknot.SourceTreeNotMAS fileDoubleClickBehaviour -int 1
# Set file filter status to sort by path alphabetically
defaults write com.torusknot.SourceTreeNotMAS fileStatusFilterMode -int 1
# Set staging view to split view
defaults write com.torusknot.SourceTreeNotMAS fileStatusStagingViewMode -int 1
# Fetch and prune
defaults write com.torusknot.SourceTreeNotMAS gitFetchPrune -int 1
# Suppress file amend warning
defaults write com.torusknot.SourceTreeNotMAS gitSuppressWarnOnAmend -int 1
# Disable tips
defaults write com.torusknot.SourceTreeNotMAS showStagingTip -bool false
defaults write com.torusknot.SourceTreeNotMAS showToolbarTip -bool false
###############################################################################
# LaunchBar #
###############################################################################
# Set calculator hot key to Cmd-Shift-=
defaults write at.obdev.LaunchBar CalculatorHotKey -string "768@24"
defaults write at.obdev.LaunchBar CalculatorHotKeyEnabled -bool true
# Clipboard history
defaults write at.obdev.LaunchBar ClipboardHistoryCapacity -int 40
defaults write at.obdev.LaunchBar ClipboardHistoryPreferPlainText -bool true
# Enable instant snd with Shift-Shift
defaults write at.obdev.LaunchBar ModifierTapInstantSend -int 24
###############################################################################
# Finished #
###############################################################################
echo "Done. Note that some of these changes require a logout/restart to take effect."