-
Notifications
You must be signed in to change notification settings - Fork 4
/
.macos
executable file
·263 lines (204 loc) · 10.5 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
#!/usr/bin/env bash
# Thanks to Mathias Bynens! https://mths.be/macos
# Thanks to Dries Vints
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
## System Preferences → General
# → Appearance: Dark
defaults write -g 'AppleInterfaceStyle' -string 'Dark'
# → Sidebar icon size → medium
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1
## System Preferences → Desktop & Screen Saver
# → Screen Saver → Flurry
defaults write 'com.apple.screensaver' moduleDict -dict moduleName -string "Flurry" path -string "/System/Library/Screen Savers/Flurry.saver" type -int 0
## System Preferences → Dock
# → Size → 48
defaults write 'com.apple.dock' 'tilesize' -int 48
# → Magnification → off & 64
defaults write 'com.apple.dock' 'magnification' -bool true
defaults write 'com.apple.dock' 'largesize' -int 64
# → Minimize windows using → Scale effect
defaults write 'com.apple.dock' 'mineffect' -string 'scale'
# → Show indicators for open applications → false
defaults write com.apple.dock show-process-indicators -bool false
# → Show recent application in Dock → false
defaults write com.apple.dock show-recents -bool false
## System Preferences → Mision Control
# → Automatically rearrange Spaces based on most recent use → false
defaults write 'com.apple.dock' 'mru-spaces' -bool false
# → Display have separate Spaces → false
defaults write 'com.apple.dock' 'spans-displays' -bool false
# → Dashboard → false
defaults write 'com.apple.dashboard' 'mcx-disabled' -bool true
# → Don’t show Dashboard as a Space
defaults write 'com.apple.dock' 'dashboard-in-overlay' -bool true
## System Preferences → Mision Control → Hot corners...
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
# → Top right screen corner → Mission Control
defaults write 'com.apple.dock' 'wvous-tr-corner' -int 2
defaults write 'com.apple.dock' 'wvous-tr-modifier' -int 0
# → Bottom right screen corner → Mission Control
defaults write 'com.apple.dock' 'wvous-br-corner' -int 2
defaults write 'com.apple.dock' 'wvous-br-modifier' -int 0
## System Preferences → Language & Region
# → Preferred languages → en, nl
defaults write NSGlobalDomain AppleLanguages -array "en" "nl"
# → Region → Belgium
defaults write NSGlobalDomain AppleLocale -string "en_BE"
# -> Advanced -> Measurement units
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
defaults write NSGlobalDomain AppleMetricUnits -bool true
## System Preferences → Security & Privacy
# → General → Require password → immediately
defaults write 'com.apple.screensaver' 'askForPassword' -int 1
defaults write 'com.apple.screensaver' 'askForPasswordDelay' -int 0
# → Firewall → On
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1
## System Preferences → Notifications
# I can't find anything fo this, so this needs to happen manually :-(
## System Preferences → Displays
# → Show mirroring options in the menu bar when available → false
defaults write 'com.apple.airplay' 'showInMenuBarIfPresent' -bool false
## System Preferences → Keyboard
# → Keyboard → Use F1, F2, ... → true
defaults write 'com.apple.keyboard.fnState' -boolean true
# → Shortcuts → Full Keyboard Access... → All Controls
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
## System Preferences → Trackpad
# → Point & Click → Tap to click → true
defaults write 'com.apple.driver.AppleBluetoothMultitouch.trackpad' 'Clicking' -bool true
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
## System Preferences → Sound
# → Sound Effects → Play user interface sound effects → false
defaults write "Apple Global Domain" com.apple.sound.uiaudio.enabled -int 0
# → Sound Effects → Play feedback when volume is changed → false
defaults write 'com.apple.systemsound' 'com.apple.sound.beep.feedback' -int 0
## System Preferences → Software Update
# Check for software updates daily, not just once per week
defaults write 'com.apple.SoftwareUpdate' 'ScheduleFrequency' -int 1
## System Preferences → Bluetooth
# → Show Bluetooth in menu bar → true
# I can't find anything for this, so add it tho the menu manually :-(
## System Preferences → Users & Groups
# Disable Guest access
sudo defaults write /Library/Preferences/com.apple.AppleFileServer guestAccess -bool false
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool false
## System Preferences → Siri
defaults write 'com.apple.SiriNCService' 'AppleLanguages' -array "nl-BE"
defaults write 'com.apple.SiriNCService' 'AppleLocale' -string "nl_BE"
## System Preferences → Date & Time
# → Clock → Show date → true
defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM HH:mm"
## Finder → Preferences
# → General → Show items on desktop → none
defaults write 'com.apple.finder' 'ShowHardDrivesOnDesktop' -int 0
defaults write 'com.apple.finder' 'ShowExternalHardDrivesOnDesktop' -int 0
defaults write 'com.apple.finder' 'ShowRemovableMediaOnDesktop' -int 0
defaults write 'com.apple.finder' 'ShowMountedServersOnDesktop' -int 0
# → Sidebar →
# @todo: check if this can be automated
# → Advanced → Show all filename extenstions → true
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# → Advanced → Show warning before changing an extenstion → false
defaults write 'com.apple.finder' 'FXEnableExtensionChangeWarning' -bool false
# → Advanced → When performing a search → Search the Current Folder
defaults write 'com.apple.finder' 'FXDefaultSearchScope' -string "SCcf"
## Finder → Other settings
# → show path bar
defaults write 'com.apple.finder' 'ShowPathbar' -bool true
# → show status bar
defaults write 'com.apple.finder' 'ShowStatusBar' -bool true
# → allow text selection in Quick Look
defaults write 'com.apple.finder' 'QLEnableTextSelection' -bool true
# → avoid creating .DS_Store files on network volumes
defaults write 'com.apple.desktopservices' 'DSDontWriteNetworkStores' -bool true
# → use column view
# Possible values:
# icnv: icons
# clmv: columns
# Nlsv: list
# Flwv: coverflow
defaults write 'com.apple.finder' 'FXPreferredViewStyle' -string "clmv"
# → enable snap-to-grid
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" $HOME/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" $HOME/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" $HOME/Library/Preferences/com.apple.finder.plist
# → expand "General", "Sharing & Permissions" by default
defaults write 'com.apple.finder' FXInfoPanesExpanded -dict \
General -bool true \
Privileges -bool true
# → show the ~/Library folder
chflags nohidden $HOME/Library
# → show hidden files
defaults write 'com.apple.finder' 'AppleShowAllFiles' -bool true
## Terminal → Preferences
# → General → On startup, open → Tijs
defaults write 'com.apple.terminal' 'Default Window Settings' -string "Tijs"
defaults write 'com.apple.terminal' 'Startup Window Settings' -string "Tijs"
# → Encodings
defaults write 'com.apple.terminal' 'StringEncodings' -array 4
# → Disable Marks, see http://apple.stackexchange.com/questions/209635/what-functionality-do-marks-offer-in-the-el-capitan-terminal
defaults write 'com.apple.Terminal' 'AutoMarkPromptLines' -int 0
## Dock
# → remove all app icons
defaults write 'com.apple.dock' 'persistent-apps' -array
# → show only open applications
defaults write 'com.apple.dock' 'static-only' -bool true
## Calendar → Preferences
# → General → Start week on → Monday
defaults write 'com.apple.iCal' "first day of week" -int 1
# → General → Day starts at → 09:00
defaults write 'com.apple.iCal' 'first minute of day time range' 540
## Mail → Preferences
# → General → New messages sound → None
defaults write 'com.apple.mail' 'NewMessagesSoundName' -string ""
# → General → Play sounds for other mail actions → false
defaults write 'com.apple.mail' 'PlayMailSounds' -int 0
# → General → Dock unread count → All Mailboxes
defaults write 'com.apple.mail' 'MailDockBadge' -int 2
# → General → New message notifications → VIPs
defaults write 'com.apple.mail' 'MailUserNotificationScope' -int 2
# → Viewing → List preview → 1 Line
defaults write 'com.apple.mail' 'NumberOfSnippetLines' -int 1
# → Viewing → Show most recent message at the top → true
defaults write 'com.apple.mail' 'ConversationViewSortDescending' -int 1
# → Composing → Composing → Message Format → Plain Text
defaults write 'com.apple.mail' 'SendFormat' -string "Plain"
# → Composing → Responding → When quoting text in replies or forwards → Include all of the original message text
defaults write 'com.apple.mail' 'AlwaysIncludeOriginalMessage' -int 1
## Mail → Other settings
# → Copy email addresses as `[email protected]` instead of `Foo Bar <[email protected]>`
defaults write 'com.apple.mail' 'AddressesIncludeNameOnPasteboard' -bool false
## Safari → Preferences
# → Advanced → Show Develop menu in menu bar → true
defaults write 'com.apple.Safari' 'IncludeInternalDebugMenu' -bool true
## Some random UX stuff
# → increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# → disable "Are you sure you want to open this application?" dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# → disable smart quotes as they're annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# → disable smart dashes as they're annoying when typing code
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# → expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
## Kill affected applications #
for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
"Dock" "Finder" "Mail" "Messages" "Photos" "Safari" "SystemUIServer" \
"Terminal" "iCal"; do
killall "${app}" &> /dev/null
done
echo "🍺 Done, please reboot."