Skip to content

Instantly share code, notes, and snippets.

@gddabe
Last active February 16, 2016 17:16
Show Gist options
  • Save gddabe/86d17e81b9864d1fa4d1 to your computer and use it in GitHub Desktop.
Save gddabe/86d17e81b9864d1fa4d1 to your computer and use it in GitHub Desktop.
added new general settings
#!/bin/bash
# General
# ------------------------------------------------------------------------------
echo "Disable .DS_Store files on network and usb volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -boolean true
defaults write com.apple.desktopservices DSDontWriteUSBStores -boolean true
echo "Enable dark mode and reduce transparency"
defaults write .GlobalPreferences AppleInterfaceStyle -string "Dark"
echo "Enable full keyboard access for all controls"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
echo "Set the locale"
defaults write NSGlobalDomain AppleLocale -string "en_HK"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
defaults write NSGlobalDomain AppleMetricUnits -boolean true
echo "Double-click a window's title bar to minimize"
defaults write NSGlobalDomain AppleMiniaturizeOnDoubleClick -boolean true
echo "Use smooth scrolling"
defaults write NSGlobalDomain AppleScrollAnimationEnabled -boolean true
echo "Enable key repeat"
defaults write NSGlobalDomain ApplePressAndHoldEnabled -boolean false
echo "Set keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 2
echo "Show the ~/Library directory"
chflags nohidden "${HOME}/Library"
# Finder
# ------------------------------------------------------------------------------
echo "Use column view"
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
echo "Show home folder when opening new windows"
defaults write com.apple.finder NewWindowTarget -string "PfHm"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
echo "Search the current folder by default"
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
echo "Disable the warning when changing a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -boolean false
echo "Show status bar"
defaults write com.apple.finder ShowStatusBar -boolean true
echo "Show path bar"
defaults write com.apple.finder ShowPathbar -boolean true
echo "Display full POSIX path as Finder window title"
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
echo "Show icons for servers and removable media on the desktop"
defaults write com.apple.finder ShowHardDrivesOnDesktop -boolean false
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -boolean true
defaults write com.apple.finder ShowMountedServersOnDesktop -boolean true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -boolean true
echo "Set up desktop icon view"
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy kind" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 72" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:labelOnBottom 0" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo 1" ~/Library/Preferences/com.apple.finder.plist
# Dock
# ------------------------------------------------------------------------------
echo "Minimize windows into their application icon"
defaults write com.apple.dock minimize-to-application -boolean true
echo "Set the icon size of Dock items to 30 to 60 pixels"
defaults write com.apple.dock magnification -boolean true
defaults write com.apple.dock tilesize -integer 30
defaults write com.apple.dock largesize -integer 60
# Possible values:
# 0: no-op
# 2: Mission Control (all windows)
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
echo "Set the hot corners"
# Top left screen corner → Start screen saver
defaults write com.apple.dock wvous-tl-corner -int 5
defaults write com.apple.dock wvous-tl-modifier -int 0
# Top right screen corner → Show application windows
defaults write com.apple.dock wvous-tr-corner -int 2
defaults write com.apple.dock wvous-tr-modifier -int 0
# Bottom right screen corner → Desktop
defaults write com.apple.dock wvous-br-corner -int 4
defaults write com.apple.dock wvous-br-modifier -int 0
# Bottom left screen corner → no-op
defaults write com.apple.dock wvous-bl-corner -int 0
defaults write com.apple.dock wvous-bl-modifier -int 0
# App
# ------------------------------------------------------------------------------
echo "Use Plain Text Mode as Default"
defaults write com.apple.TextEdit RichText -int 0
echo "Killing all related processes.."
for app in Finder Dock SystemUIServer; do killall "$app" >/dev/null 2>&1; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment