2016-09-25 20:43:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2015-11-16 13:45:49 +00:00
|
|
|
# Set standby delay to 24 hours (default is 1 hour)
|
|
|
|
sudo pmset -a standbydelay 86400
|
|
|
|
|
|
|
|
# Disable the sound effects on boot
|
|
|
|
sudo nvram SystemAudioVolume=" "
|
|
|
|
|
|
|
|
# Remove the dock delay.
|
|
|
|
defaults write com.apple.Dock autohide-delay -float 0
|
|
|
|
|
2016-09-25 20:43:41 +00:00
|
|
|
# Change the size of Dock icons.
|
2016-09-28 17:58:54 +00:00
|
|
|
defaults write com.apple.dock tilesize -int 30
|
2016-09-25 20:43:41 +00:00
|
|
|
|
|
|
|
# Reduce transparency.
|
2015-11-16 13:45:49 +00:00
|
|
|
defaults write com.apple.universalaccess reduceTransparency -bool true
|
|
|
|
|
2016-09-25 20:43:41 +00:00
|
|
|
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
|
|
|
|
defaults write com.apple.TextEdit RichText -int 0
|
|
|
|
|
|
|
|
# Change the location for screenshots.
|
|
|
|
defaults write com.apple.screencapture location -string "${HOME}/Pictures/Screenshots"
|
|
|
|
|
|
|
|
# Disable smart dashes.
|
|
|
|
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
|
|
|
|
|
|
|
|
# Enable full keyboard access for all controls
|
|
|
|
defaults write NSGlobalDomain AppleKeyboardUIMode -int 0
|
|
|
|
|
|
|
|
# Disable press-and-hold for keys in favor of key repeat
|
|
|
|
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
|
|
|
|
|
|
|
# Set a blazingly fast keyboard repeat rate, and make it happen more quickly.
|
|
|
|
defaults write NSGlobalDomain InitialKeyRepeat -int 20
|
|
|
|
defaults write NSGlobalDomain KeyRepeat -int 1
|
|
|
|
|
|
|
|
# Disable auto-correct
|
|
|
|
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Finder: show all filename extensions
|
|
|
|
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
|
|
|
|
|
|
|
|
# Finder: hide status bar
|
|
|
|
defaults write com.apple.finder ShowStatusBar -bool false
|
|
|
|
|
|
|
|
# Finder: hide path bar
|
|
|
|
defaults write com.apple.finder ShowPathbar -bool false
|
|
|
|
|
2016-09-28 20:14:19 +00:00
|
|
|
# Finder: hide icons on the Desktop.
|
|
|
|
defaults write com.apple.finder CreateDesktop -bool false
|
2016-09-25 20:43:41 +00:00
|
|
|
|
|
|
|
# Disable the warning when changing a file extension
|
|
|
|
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
|
|
|
|
|
|
|
|
|
|
|
# Show the ~/Library folder
|
|
|
|
chflags nohidden ~/Library
|
|
|
|
|
|
|
|
# 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 \
|
|
|
|
Preview -bool false \
|
|
|
|
Privileges -bool true
|
|
|
|
|
|
|
|
# Trackpad: enable tap on click.
|
|
|
|
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
|
|
|
|
|
|
|
|
# Keyboard: Use F1, F2 as function keys.
|
|
|
|
defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true
|
|
|
|
|
|
|
|
# Restart affected applications if `--no-restart` flag is not present.
|
|
|
|
if [[ ! ($* == *--no-restart*) ]]; then
|
|
|
|
for app in "cfprefsd" "Dock" "Finder" "SystemUIServer"; do
|
|
|
|
killall "${app}" > /dev/null 2>&1
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf "Please log out and log back in to make all settings take effect.\n"
|