Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
executable file 140 lines (96 sloc) 5.12 KB
#!/usr/bin/env bash
# Based on:
# 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 &
# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool true
# Menu bar: show remaining battery time (on pre-10.8); hide percentage
defaults write ShowPercent -string "NO"
defaults write ShowTime -string "YES"
# Set highlight color to green
defaults write NSGlobalDomain AppleHighlightColor -string '0.764700 0.976500 0.568600'
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Disable the “Are you sure you want to open this application?” dialog
defaults write LSQuarantine -bool false
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
sudo defaults write /Library/Preferences/ AdminHostInfo HostName
# Check for software updates daily, not just once per week
defaults write ScheduleFrequency -int 1
# Restart automatically if the computer freezes
systemsetup -setrestartfreeze on
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Save screenshots to the desktop
defaults write location -string "$HOME/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write type -string "png"
# Finder: show hidden files by default
defaults write AppleShowAllFiles -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Display full POSIX path as Finder window title
defaults write _FXShowPosixPathInTitle -bool true
# Disable the warning when changing a file extension
defaults write FXEnableExtensionChangeWarning -bool false
# Avoid creating .DS_Store files on network volumes
defaults write DSDontWriteNetworkStores -bool true
# Automatically open a new Finder window when a volume is mounted
defaults write auto-open-ro-root -bool true
defaults write auto-open-rw-root -bool true
defaults write OpenWindowForNewRemovableDisk -bool true
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash
defaults write WarnOnEmptyTrash -bool false
# Empty Trash securely by default
defaults write EmptyTrashSecurely -bool true
# Enable spring loading for all Dock items
defaults write enable-spring-load-actions-on-all-items -bool true
# Show indicator lights for open applications in the Dock
defaults write show-process-indicators -bool true
# Don’t animate opening applications from the Dock
defaults write launchanim -bool true
# Set dock tile size
defaults write tilesize -int 60
# set dock tile large size
defaults write largesize -int 85
# autohide dock
defaults write autohide -bool true
# remove delay
defaults write autohide-delay -float 0
# Speed up Mission Control animations
defaults write expose-animation-duration -float 0.1
# Don’t group windows by application in Mission Control
# (i.e. use the old Exposé behavior instead)
defaults write expose-group-by-app -bool false
# Disable local Time Machine backups
hash tmutil &> /dev/null && sudo tmutil disablelocal
# Allow text selection in the Quick Look window
defaults write QLEnableTextSelection -bool true
# Disable the sudden motion sensor as it’s not useful for SSDs
sudo pmset -a sms 0
# Disable the crash reporter
defaults write DialogType -string "none"
# Stop iTunes from responding to the keyboard media keys
launchctl unload -w /System/Library/LaunchAgents/ 2> /dev/null
# Require password immediately after sleep or screen saver begins
defaults write askForPassword -int 1
defaults write askForPasswordDelay -int 0
# Don’t display the annoying prompt when quitting iTerm
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
# Disable natural scrolling
defaults write -g -bool false
# Disable useless dashboard
defaults write mcx-disabled -boolean YES && killall Dock