-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmacos
More file actions
executable file
·253 lines (186 loc) · 10.2 KB
/
macos
File metadata and controls
executable file
·253 lines (186 loc) · 10.2 KB
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
#!/usr/bin/env zsh
# To reset a setting made with `defaults`:
#
# defaults delete <domain>
#
# Example:
#
# defaults delete com.apple.Dock
# First, close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# 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 &
# macOS Tahoe
# Disable icons-in-menus
defaults write -g NSMenuEnableActionImages -bool NO
# -- Dock --
# Automatically hide and show the Dock
defaults write com.apple.Dock autohide -int 1
# Dock - Remove the auto-hiding delay
defaults write com.apple.Dock autohide-delay -float 0
# Don’t show recent applications in the Dock
defaults write com.apple.Dock show-recents -bool false
# Turn on Dock magnification
defaults write com.apple.Dock magnification -int 1
defaults write com.apple.Dock tilesize -int 40
# Remove various stock apps from Dock
apps=("Photos" "Notes" "Reminders" "Freeform" "TV" "News" "Keynote" "Numbers" "Pages" "App Store" "FaceTime" "Launchpad")
for app in $apps; do
~/./bin/rm-app-from-dock "$app"
done
# Always show scroll bars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
killall Dock
# Hot Corners
# top left: Mission Control
defaults write com.apple.Dock wvous-tl-corner -int 2
# top right: Notification Center
defaults write com.apple.Dock wvous-tr-corner -int 12
# bottom left: Show Desktop
defaults write com.apple.Dock wvous-bl-corner -int 4
# bottom right: Start screen saver
defaults write com.apple.Dock wvous-br-corner -int 5
# Disable Spotlight menu item - cmd-space ftw
defaults write com.apple.Spotlight MenuItemHidden -bool true
# Disable Spotlight suggestions - does this still work? ck after reboot
# defaults write com.apple.Spotlight SuggestionsEnabled -bool false
###############################################################################
# General UI/UX #
###############################################################################
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Enable automatic termination of inactive apps
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# Disable dictionary lookup on deep trackpad press
defaults write com.apple.AppleMultitouchTrackpad ForceSuppressed -bool true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad ForceSuppressed -bool true
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain InitialKeyRepeat -int 20
defaults write NSGlobalDomain KeyRepeat -int 1
# Enable lid wakeup
sudo pmset -a lidwake 1
# Restart automatically on power loss
sudo pmset -a autorestart 1
# Restart automatically if the computer freezes
sudo systemsetup -setrestartfreeze on
# Sleep the display after 15 minutes
sudo pmset -a displaysleep 15
# Disable machine sleep while charging
sudo pmset -c sleep 0
###############################################################################
# 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
# Where Shift-Cmd-3 and Shift-Cmd-4 save screenshots to
defaults write com.apple.screencapture location ~/Desktop
###############################################################################
# Finder #
###############################################################################
# Show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool false
# Show all files, including hidden ones
defaults write com.apple.finder AppleShowAllFiles -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
# Literally never use Siri
defaults write com.apple.Siri StatusMenuVisible -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
# 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
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Show the /Volumes folder
sudo chflags nohidden /Volumes
# 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
###############################################################################
# Safari & WebKit #
###############################################################################
defaults write com.apple.Safari AutoOpenSafeDownloads -bool true
defaults write com.apple.Safari SearchProviderShortName -string DuckDuckGo
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# 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
# Enable continuous spellchecking
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true
# Safari: Disable auto-correct
defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false
# Safari: Disable AutoFill
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
defaults write com.apple.Safari AutoFillPasswords -bool false
defaults write com.apple.Safari AutoFillCreditCardData -bool false
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false
# Update extensions automatically
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
###############################################################################
# Mac App Store #
###############################################################################
# Enable the automatic update check
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# Check for software updates daily, not just once per week
# defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Download newly available updates in background
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
# Install System data files & security updates
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
# Turn on app auto-update
defaults write com.apple.commerce AutoUpdate -bool true
# Allow the App Store to reboot machine on macOS updates
defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
###############################################################################
# Misc #
###############################################################################
# TextEdit - Use plain text mode for new documents
defaults write com.apple.TextEdit RichText -int 0
# Disk Utility - Enable debug menu
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
# App Store - Enable the WebKit Developer Tools in the Mac App Store
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# App Store - Enable Debug Menu in the Mac App Store
defaults write com.apple.appstore ShowDebugMenu -bool true
# -- Chrome
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool true
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool true
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool true
defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool true
# -- VSCode
# These settings are recommended when using the (neo)vim plugin in VSCode
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
defaults write com.vscodium ApplePressAndHoldEnabled -bool false # For VS Codium
defaults write com.microsoft.VSCodeExploration ApplePressAndHoldEnabled -bool false # For VS Codium Exploration users
# defaults delete -g ApplePressAndHoldEnabled
###############################################################################
# Music
###############################################################################
# Turn off notifications when the song changes
defaults write com.apple.Music userWantsPlaybackNotifications -bool false