2012-06-18 01:10:31 +02:00
|
|
|
|
# OS X defaults
|
|
|
|
|
#
|
|
|
|
|
# most of it taken from @mathiasbynens
|
|
|
|
|
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
|
|
|
|
|
########################################################################
|
|
|
|
|
|
2014-06-16 11:01:17 +02:00
|
|
|
|
# Ask for the administrator password upfront
|
|
|
|
|
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 &
|
2012-11-27 16:38:54 +01:00
|
|
|
|
|
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
|
|
|
|
# Trackpad, mouse, keyboard, and input #
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
2012-06-18 01:10:31 +02:00
|
|
|
|
# Disable auto-correct
|
|
|
|
|
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
|
|
|
|
|
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
|
|
|
|
# Finder #
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
2012-06-18 01:10:31 +02:00
|
|
|
|
# Allow text selection in Quick Look
|
|
|
|
|
defaults write com.apple.finder QLEnableTextSelection -bool true
|
|
|
|
|
|
|
|
|
|
# Disable disk image verification
|
|
|
|
|
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
|
|
|
|
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
|
|
|
|
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
|
|
|
|
|
|
|
|
|
# Avoid creating .DS_Store files on network volumes
|
|
|
|
|
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
|
|
|
|
|
2014-06-16 11:01:17 +02:00
|
|
|
|
# Enable snap-to-grid for icons on the desktop and in other icon views
|
2012-06-18 01:10:31 +02:00
|
|
|
|
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
2014-06-16 11:01:17 +02:00
|
|
|
|
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
|
|
|
|
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
2012-06-18 01:10:31 +02:00
|
|
|
|
|
|
|
|
|
# Disable the warning before emptying the Trash
|
|
|
|
|
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
|
|
|
|
|
|
|
|
|
# Show the ~/Library folder
|
2012-06-28 19:45:03 +02:00
|
|
|
|
chflags nohidden ~/Library
|
|
|
|
|
|
2012-11-27 16:38:54 +01:00
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
2014-06-16 11:01:17 +02:00
|
|
|
|
# Dock, Dashboard, and hot corners #
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
2012-06-18 01:10:31 +02:00
|
|
|
|
|
|
|
|
|
# Add a spacer to the left side of the Dock (where the applications are)
|
|
|
|
|
#defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
|
|
|
|
|
# Add a spacer to the right side of the Dock (where the Trash is)
|
|
|
|
|
#defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
|
|
|
|
|
|
2012-11-27 16:38:54 +01:00
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
|
|
|
|
# Safari & WebKit #
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
2014-06-16 11:01:17 +02:00
|
|
|
|
# Set Safari’s home page to `about:blank` for faster loading
|
|
|
|
|
defaults write com.apple.Safari HomePage -string "about:blank"
|
|
|
|
|
|
2012-06-18 01:10:31 +02:00
|
|
|
|
# Make Safari’s search banners default to Contains instead of Starts With
|
|
|
|
|
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
# Set web style sheet
|
2014-06-16 11:01:17 +02:00
|
|
|
|
defaults write com.apple.Safari UserStyleSheetEnabled -bool true
|
|
|
|
|
defaults write com.apple.Safari UserStyleSheetLocationURLString -string "~/Projects/dotfiles/webstyle.css"
|
|
|
|
|
defaults write com.apple.Safari WebKitUserStyleSheetLocationPreferenceKey -string "~/Projects/webstyle.css"
|
2012-11-27 16:38:54 +01:00
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
|
|
|
|
|
###############################################################################
|
2014-06-16 11:01:17 +02:00
|
|
|
|
# Mail #
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
2012-06-18 01:10:31 +02:00
|
|
|
|
|
|
|
|
|
# Copy email addresses as `foo@example.com` instead of `Foo Bar <foo@example.com>` in Mail.app
|
|
|
|
|
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
|
|
|
|
|
|
2012-11-27 16:38:54 +01:00
|
|
|
|
|
2014-11-03 17:40:13 +01:00
|
|
|
|
###############################################################################
|
|
|
|
|
# SSD-specific tweaks #
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
# Disable local Time Machine snapshots
|
|
|
|
|
sudo tmutil disablelocal
|
|
|
|
|
|
|
|
|
|
# Disable the sudden motion sensor as it’s not useful for SSDs
|
|
|
|
|
sudo pmset -a sms 0
|
|
|
|
|
|
2014-06-16 11:01:17 +02:00
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
|
|
|
|
# Terminal #
|
|
|
|
|
###############################################################################
|
2012-06-25 18:52:41 +02:00
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
# Only use UTF-8 in Terminal.app
|
|
|
|
|
defaults write com.apple.terminal StringEncodings -array 4
|
|
|
|
|
|
2012-11-27 16:38:54 +01:00
|
|
|
|
|
2012-06-28 19:45:03 +02:00
|
|
|
|
###############################################################################
|
|
|
|
|
# Time Machine #
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
# Prevent Time Machine from prompting to use new hard drives as backup volume
|
2012-07-04 04:10:04 +02:00
|
|
|
|
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
|
|
|
|
|
|
|
|
|
|
# Disable local Time Machine backups
|
2014-06-16 11:01:17 +02:00
|
|
|
|
hash tmutil &> /dev/null && sudo tmutil disablelocal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
2014-11-03 17:40:13 +01:00
|
|
|
|
# Kill affected applications #
|
2014-06-16 11:01:17 +02:00
|
|
|
|
###############################################################################
|
|
|
|
|
|
2014-11-03 17:40:13 +01:00
|
|
|
|
for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
|
|
|
|
|
"Dock" "Finder" "Mail" "Messages" "Safari" "SystemUIServer" \
|
|
|
|
|
"Terminal"; do
|
|
|
|
|
killall "${app}" > /dev/null 2>&1
|
|
|
|
|
done
|
|
|
|
|
echo "Done. Note that some of these changes require a logout/restart to take effect."
|