-
Notifications
You must be signed in to change notification settings - Fork 1
/
.macos
208 lines (152 loc) · 7.65 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
#!/usr/bin/env bash
# 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
# Borrowed from Paul Irish (https://github.com/paulirish/dotfiles)
#---------------------------------------#
# General UI/UX #
#---------------------------------------#
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# 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
# Check for software updates daily, not just once per week
#defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Show the ~/Library folder
chflags nohidden ~/Library
# Scrollbars
# Possible values: `WhenScrolling`, `Automatic` and `Always`
defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling"
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
#---------------------------------------#
# Dock/Hot Corners #
#---------------------------------------#
# Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock tilesize -int 34
# Change minimize/maximize window effect
defaults write com.apple.dock mineffect -string "scale"
# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Don’t show recent applications in Dock
defaults write com.apple.dock show-recents -bool false
# set bottom left hot corner to start screen saver
defaults write com.apple.dock wvous-bl-corner -int 5
#---------------------------------------#
# SSD Specific Tweaks #
#---------------------------------------#
# Disable local Time Machine snapshots
#sudo tmutil disablelocal
# Disable hibernation (speeds up entering sleep mode)
#sudo pmset -a hibernatemode 0
# Remove the sleep image file to save disk space
# sudo rm /Private/var/vm/sleepimage
# Create a zero-byte file instead…
# sudo touch /Private/var/vm/sleepimage
# …and make sure it can’t be rewritten
# sudo chflags uchg /Private/var/vm/sleepimage
# Disable the sudden motion sensor as it’s not useful for SSDs
#sudo pmset -a sms 0
#---------------------------------------#
# Screen #
#---------------------------------------#
# Enable subpixel font rendering on non-Apple LCDs
#defaults write NSGlobalDomain AppleFontSmoothing -int 2
# Enable HiDPI display modes (requires restart)
#sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
#---------------------------------------#
# Finder #
#---------------------------------------#
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# 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"
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Play iOS charging sound when MagSafe connected
defaults write com.apple.PowerChime ChimeOnAllHardware -bool true &&
open /System/Library/CoreServices/PowerChime.app
# Disable iOS charging sound when MagSafe connected
# defaults write com.apple.PowerChime ChimeOnAllHardware -bool false && \
#killall PowerChime
# Search current directory by default in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Set sidebar icon size to small
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
#---------------------------------------#
# Activity Monitor #
#---------------------------------------#
# Visualize CPU usage in the Activity Monitor Dock icon
defaults write com.apple.ActivityMonitor IconType -int 5
#---------------------------------------#
# Mac App Store #
#---------------------------------------#
# Enable the WebKit Developer Tools in the Mac App Store
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# Enable Debug Menu in the Mac App Store
#defaults write com.apple.appstore ShowDebugMenu -bool true
#---------------------------------------#
# Safari #
#---------------------------------------#
# Show the full URL in the address bar (note: this still hides the scheme)
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
# Prevent Safari from opening ‘safe’ files automatically after downloading
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
# 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
# Update extensions automatically
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
# Set Safari’s home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string "https://start.amitd.co"
# Don't reopen windows/tabs from previous session
chflags uchg ~/Library/Saved\ Application\ State/com.apple.Safari.savedState
chflags uchg ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.db
chflags uchg ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.db-shm
chflags uchg ~/Library/Containers/com.apple.Safari/Data/Library/Safari/SafariTabs.db-wal
defaults write com.apple.Safari NSQuitAlwaysKeepsWindows -bool false
#---------------------------------------#
# Terminal/iTerm #
#---------------------------------------#
# Don’t display the annoying prompt when quitting iTerm
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
#---------------------------------------#
# Fix "Beep" in macOS #
#---------------------------------------#
mkdir -p ~/Library/KeyBindings
echo "{
\"^@\\\UF701\" = \"noop:\";
\"^@\\\UF702\" = \"noop:\";
\"^@\\\UF703\" = \"noop:\";
}" > ~/Library/KeyBindings/DefaultKeyBinding.dict
for app in "Activity Monitor" \
"Dock" \
"Finder" \
"SystemUIServer"; do
killall "${app}" &> /dev/null
done