-
Notifications
You must be signed in to change notification settings - Fork 5
/
osx
executable file
·172 lines (126 loc) · 6.74 KB
/
osx
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
#!/usr/bin/env bash
# Set custom OS X defaults
# See also:
# https://github.com/mathiasbynens/dotfiles
# https://github.com/Wilto/dotfiles/blob/master/bin/osxdefaults
# -----------------------------------------------------------------------------
# SECURITY
# -----------------------------------------------------------------------------
# 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
# -----------------------------------------------------------------------------
# GENERAL
# -----------------------------------------------------------------------------
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Disable automatic termination of inactive apps
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# Disable the focus ring animation
defaults write -globalDomain NSUseAnimatedFocusRing -bool NO
# -----------------------------------------------------------------------------
# DOCK
# -----------------------------------------------------------------------------
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Set the icon size of Dock items to 44 pixels
defaults write com.apple.dock tilesize -int 44
# Show indicator lights for open applications
defaults write com.apple.dock show-process-indicators -bool true
# Use the scale effect for window minimizing
defaults write com.apple.dock mineffect scale
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.1
# -----------------------------------------------------------------------------
# FINDER
# -----------------------------------------------------------------------------
# Show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# Hide the ~/Public folder
chflags hidden ~/Public
# Hide the ~/Movies folder
chflags hidden ~/Movies
# Hide the ~/Music folder (iTunes manages this folder, look not upon the horrors within)
chflags hidden ~/Music
# Use column view in all windows by default
# Four-letter codes for views modes: `icnv`, `Nlsv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
# Show no mounted media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# -----------------------------------------------------------------------------
# SHEETS/PANELS
# -----------------------------------------------------------------------------
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# -----------------------------------------------------------------------------
# SCREENSHOTS
# -----------------------------------------------------------------------------
# Save screenshots to ~/Pictures/Screengrabs
mkdir ~/Pictures/Screengrabs
defaults write com.apple.screencapture location -string "$HOME/Pictures/Screengrabs"
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# -----------------------------------------------------------------------------
# DISKS
# -----------------------------------------------------------------------------
# Don’t create .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable Time Machine prompts when attaching USB media
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# -----------------------------------------------------------------------------
# ITUNES
# -----------------------------------------------------------------------------
# Make ⌘ + F focus the search input in iTunes
defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Field" "@F"
# -----------------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------------
# Speed up Magic Mice
# The maximum available in the preference pane is 3.0
defaults write -g com.apple.mouse.scaling 5.0
# Don’t open Photos.app on each new device connection
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES
# Set a blazing-fast key repeat rate
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
# -----------------------------------------------------------------------------
# MISC
# -----------------------------------------------------------------------------
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
# Disable spotlight Dictionary results
defaults write com.apple.spotlight DictionaryLookupEnabled -bool false
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
defaults write -g NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0
defaults write com.apple.dock expose-animation-duration -float 0
defaults write com.apple.dock springboard-show-duration -float 0
defaults write com.apple.dock springboard-hide-duration -float 0
defaults write com.apple.dock springboard-page-duration -float 0
defaults write com.apple.finder DisableAllAnimations -bool true
# defaults write com.apple.Mail DisableSendAnimations -bool true
# defaults write com.apple.Mail DisableReplyAnimations -bool true
# -----------------------------------------------------------------------------
# RESTART ALL THE THINGS
# Restart OS X services after running the script
# -----------------------------------------------------------------------------
for app in "Dashboard" "Dock" "Finder" "SystemUIServer" "Terminal" "iTunes"; do
killall "$app" > /dev/null 2>&1
done