-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacos.sh
executable file
·179 lines (125 loc) · 7.39 KB
/
macos.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
#!/usr/bin/env bash
source ~/dotfiles/zsh/alex/functions.zsh
running "Close any open System Preferences panes, to prevent them from overriding"
bot "settings we’re about to change"
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
bot "I need you to enter your sudo password so I can install some things:"
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
running "Allow any Application to be installed"
sudo spctl --master-disable
running "not showing hidden files by default"
defaults write com.apple.Finder AppleShowAllFiles -bool false
running "Schedule update once a day"
defaults write SoftwareUpdate ScheduleFrequency -int 1
running "Disable smart quotes and dashes"
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
running "Correct spelling automatically"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
running "only use UTF-8 in Terminal.app"
defaults write com.apple.terminal StringEncodings -array 4
running "Expand save dialog by default"
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
running "Show the ~/Library folder in Finder"
chflags nohidden ~/Library
running "Stop that DSStore file nightmare"
defaults write com.apple.desktopservices DSDontWriteNetworkStores TRUE
running "Use current directory as default search scope in Finder"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
running "Enable autohide for the Dock"
defaults write com.apple.dock autohide -bool true
running "Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 2
running "Set keyboard no press and hold"
defaults write -g ApplePressAndHoldEnabled -bool false
running "Set a shorter Delay until key repeat"
defaults write NSGlobalDomain InitialKeyRepeat -int 15
running "Increase sound quality for Bluetooth headphones/headsets"
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
running "Disable auto correct"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
running "Enable tap to click (Trackpad)"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
running "Enable Safari's debug menu"
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
running "Disable smart quotes as it's annoying for messages that contain code"
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
running "Disable natural Lion-style scrolling"
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
running "Speed up Dock switching"
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
killall Dock
running "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
# ==============================================
# Finder
# ==============================================
bot "Setting Finder preferences"
running "Expand the Open with and Sharing & Permissions panes"
defaults write com.apple.finder FXInfoPanesExpanded -dict OpenWith -bool true Privileges -bool true
running "Show status bar"
defaults write com.apple.finder ShowStatusBar -bool true
running "New window points to home"
defaults write com.apple.finder NewWindowTarget -string "PfHm"
running "Finder: disable window animations and Get Info animations"
defaults write com.apple.finder DisableAllAnimations -bool true
running "Show icons for servers, and removable media on the desktop"
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
running "Show Path bar in Finder"
defaults write com.apple.finder ShowPathbar -bool true
running "Finder: show all filename extensions"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
running "Finder: allow text selection in Quick Look"
defaults write com.apple.finder QLEnableTextSelection -bool true
running "When performing a search, search the current folder by default"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
running "Avoid creating .DS_Store files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
running "Use list view"
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
###############################################################################
# Screen #
###############################################################################
running "Save screenshots to the desktop"
defaults write com.apple.screencapture location -string "${HOME}/Dropbox/Screenshots"
running "Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)"
defaults write com.apple.screencapture type -string "png"
running "Disable shadow in screenshots"
defaults write com.apple.screencapture disable-shadow -bool true
running "Show full file path"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
running "Show expanded state for printing"
defaults write -g PMPrintingExpandedStateForPrint -bool TRUE
bot "Please run command defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText \"LOCK MESSAGE\""
running "Privacy: don’t send search queries to Apple"
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
running "Set Safari’s home page to about:blank for faster loading"
defaults write com.apple.Safari HomePage -string "about:blank"
running "Prevent Safari from opening ‘safe’ files automatically after downloading"
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
running "Copy email addresses as [email protected] instead of Foo Bar <[email protected]> in Mail.app"
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
running "Display emails in threaded mode, sorted by date (oldest at the top)"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
running "Disable automatic spell checking"
defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled"
running "Only use UTF-8 in Terminal.app"
defaults write com.apple.terminal StringEncodings -array 4
running "Prevent Time Machine from prompting to use new hard drives as backup volume"
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
running "Disable apple sound beep feedback"
defaults write "com.apple.sound.beep.feedback" -int 1
running "7 days for Calendar"
defaults write com.apple.iCal n\ days\ of\ week 7