Skip to content

Instantly share code, notes, and snippets.

@ptb
Created July 28, 2011 21:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptb/1112586 to your computer and use it in GitHub Desktop.
Save ptb/1112586 to your computer and use it in GitHub Desktop.
#!/bin/sh
### General ###
/usr/bin/defaults write -g 'AppleAquaColorVariant' -int 6
/usr/bin/defaults write -g 'AppleHighlightColor' -string '0.600000 0.800000 0.600000'
/usr/bin/defaults write -g 'AppleShowScrollBars' -string 'Always'
# /usr/bin/defaults write -g 'AppleScrollBarVariant' -string 'DoubleBoth'
# /usr/bin/osascript -e 'tell application "System Events" to tell appearance preferences to set scroll arrow placement to together'
/usr/bin/osascript -e 'tell application "System Events" to tell appearance preferences to set recent applications limit to 0'
/usr/bin/osascript -e 'tell application "System Events" to tell appearance preferences to set recent documents limit to 0'
/usr/bin/osascript -e 'tell application "System Events" to tell appearance preferences to set recent servers limit to 0'
/usr/bin/defaults write -g 'NSQuitAlwaysKeepsWindows' -bool false
/usr/bin/defaults write com.apple.loginwindow 'TALLogoutSavesState' -bool false
/usr/bin/defaults write -g 'NSWindowResizeTime' -float .001
/usr/bin/defaults write -g 'NSAutomaticWindowAnimationsEnabled' -bool false
/usr/bin/defaults write -g 'NSNavPanelExpandedStateForSaveMode' -bool true
### Desktop & Screen Saver ###
### Desktop & Screen Saver / Desktop ###
/bin/rm "$HOME/Library/Preferences/com.apple.desktop.plist"
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:BackgroundColor array'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:BackgroundColor:0 real 0'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:BackgroundColor:1 real 0'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:BackgroundColor:2 real 0'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:DrawBackgroundColor bool true'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:ImageFilePath string /System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPane/Contents/Resources/DesktopPictures.prefPane/Contents/Resources/Transparent.png'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.desktop.plist" -c 'Add Background:default:NoImage bool true'
/usr/bin/defaults write -g 'AppleEnableMenuBarTransparency' -bool false
### Desktop & Screen Saver / Screen Saver ###
/usr/bin/defaults -currentHost write com.apple.screensaver '{ idleTime = 0; moduleDict = { moduleName = Spectrum; path = "/System/Library/Screen Savers/Spectrum.qtz"; type = 1; }; }';
/usr/bin/defaults write com.apple.dock 'wvous-tl-corner' -int 2
/usr/bin/defaults write com.apple.dock 'wvous-tl-modifier' -int 1048576
/usr/bin/defaults write com.apple.dock 'wvous-bl-corner' -int 10
/usr/bin/defaults write com.apple.dock 'wvous-bl-modifier' -int 0
### Dock ###
/usr/bin/defaults write com.apple.dock 'tilesize' -int 32
/usr/bin/defaults write com.apple.dock 'magnification' -bool false
/usr/bin/defaults write com.apple.dock 'largesize' -int 64
/usr/bin/defaults write com.apple.dock 'no-glass' -bool true
/usr/bin/defaults write com.apple.dock 'showhidden' -bool true
/usr/bin/defaults write com.apple.dock 'orientation' -string 'left'
/usr/bin/defaults write com.apple.dock 'pinning' -string 'start'
/usr/bin/defaults write com.apple.dock 'mineffect' -string 'scale'
/usr/bin/killall Dock
### Mission Control ###
### Language & Text ###
### Security & Privacy / General ###
/usr/bin/defaults write com.apple.screensaver 'askForPassword' -int 1
/usr/bin/defaults write com.apple.screensaver 'askForPasswordDelay' -int 5
### Spotlight ###
/usr/bin/sudo /usr/bin/mdutil -a -E -i off
/usr/bin/sudo /bin/mkdir '/System/Library/PreferencePanes (disabled)/'
/usr/bin/sudo /bin/mv '/System/Library/PreferencePanes/Spotlight.prefPane' '/System/Library/PreferencePanes (disabled)/'
/usr/bin/sudo /bin/chmod 0 /System/Library/CoreServices/Search.bundle
if [ ! -f /.metadata_never_index ];
then
/usr/bin/sudo /usr/bin/touch /.metadata_never_index
/usr/bin/sudo /usr/sbin/chown root:wheel /.metadata_never_index
/usr/bin/sudo /bin/chmod 0 /.metadata_never_index
/usr/bin/sudo /usr/local/bin/SetFile -d '7/20/2011 12:00:00' -m '7/20/2011 12:00:00' /.metadata_never_index
/usr/bin/sudo /usr/local/bin/SetFile -a V /.metadata_never_index
/usr/bin/sudo /usr/local/bin/SetFile -a L /.metadata_never_index
fi
if [ -d /.Spotlight-V100 ];
then
/usr/bin/sudo /bin/rm -rf /.Spotlight-V100
fi
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.symbolichotkeys.plist" -c 'Delete AppleSymbolicHotKeys:64' > /dev/null 2>&1
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.symbolichotkeys.plist" -c 'Add AppleSymbolicHotKeys:64:enabled bool false'
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.symbolichotkeys.plist" -c 'Delete AppleSymbolicHotKeys:65' > /dev/null 2>&1
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.symbolichotkeys.plist" -c 'Add AppleSymbolicHotKeys:65:enabled bool false'
### Universal Access ###
/bin/echo -n 'a' | /usr/bin/sudo /usr/bin/tee /private/var/db/.AccessibilityAPIEnabled > /dev/null 2>&1
/usr/bin/sudo /bin/chmod 444 /private/var/db/.AccessibilityAPIEnabled
# /usr/bin/osascript -e 'tell application "System Events" to set UI elements enabled to true'
### CD & DVDs ###
### Displays ###
### Displays / Display ###
/usr/bin/defaults write com.apple.BezelServices 'dAuto' -bool false
### Displays / Arrangement ###
/usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.windowserver 'DisplayLayoutToRight' -bool true
/usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.windowserver 'DisplayMainOnInternal' -bool false
### Energy Saver ###
/usr/bin/sudo /usr/bin/pmset -a sleep 0 displaysleep 10 disksleep 10 womp 1 lessbright 0 halfdim 0 autorestart 1 panicrestart 15
### Keyboard ###
/usr/bin/defaults write -g 'ApplePressAndHoldEnabled' -bool false
# TODO: This does not work
# /usr/bin/defaults -currentHost write -g '{ "com.apple.keyboard.modifiermapping.1452-544-0" = ( { HIDKeyboardModifierMappingDst = -1; HIDKeyboardModifierMappingSrc = 0; } ); "com.apple.keyboard.modifiermapping.1452-566-0" = ( { HIDKeyboardModifierMappingDst = -1; HIDKeyboardModifierMappingSrc = 0; } ); }'
### Mouse ###
### Trackpad ###
### Trackpad / Point & Click ###
/usr/bin/defaults -currentHost write -g com.apple.mouse.tapBehavior -bool true
### Trackpad / Scroll & Zoom ###
/usr/bin/defaults write -g 'com.apple.swipescrolldirection' -bool false
### Trackpad / More Gestures ###
/usr/bin/defaults write com.apple.dock 'showLaunchpadGestureEnabled' -bool false
/usr/bin/defaults write com.apple.dock 'showDesktopGestureEnabled' -bool false
### Print & Scan ###
/usr/bin/defaults write com.apple.print.PrintingPrefs 'Quit When Finished' -bool true
/usr/bin/defaults write -g PMPrintingExpandedStateForPrint -bool true
### Sound ###
/usr/bin/defaults write com.apple.systemsound 'com.apple.sound.beep.sound' -string '/System/Library/Sounds/Sosumi.aiff'
/usr/bin/defaults write com.apple.systemsound 'com.apple.sound.uiaudio.enabled' -int 0
/usr/bin/defaults write -g 'com.apple.sound.beep.feedback' -bool false
### Mail, Contacts & Calendars ###
### MobileMe ###
### Network ###
### Bluetooth ###
### Sharing ###
/usr/bin/sudo /usr/sbin/networksetup -setcomputername 'Mac'
/usr/bin/sudo /usr/sbin/systemsetup -setlocalsubnetname 'mac'
### Users & Groups ###
/usr/bin/chsh -s /bin/zsh
/usr/bin/sudo /usr/bin/chsh -s /bin/zsh
### Parental Controls ###
### Date & Time ###
/usr/bin/defaults write com.apple.menuextra.clock 'DateFormat' -string 'EEE MMM d h:mm:ss a'
### Software Update ###
/usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate 'ScheduleFrequency' -int -1
/usr/bin/sudo /usr/bin/defaults write /private/var/db/launchd.db/com.apple.launchd/overrides com.apple.softwareupdatecheck.initial -dict Disabled -bool true
/usr/bin/sudo /usr/bin/defaults write /private/var/db/launchd.db/com.apple.launchd/overrides com.apple.softwareupdatecheck.periodic -dict Disabled -bool true
/usr/bin/sudo /usr/bin/plutil -convert xml1 /private/var/db/launchd.db/com.apple.launchd/overrides.plist
/usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate 'AutomaticDownload' -bool false
### Speech ###
### Speech / Speech Recognition ###
### Speech / Text to Speech ###
/usr/bin/defaults write com.apple.speech.voice.prefs 'SelectedVoiceCreator' -int 1919902066
/usr/bin/defaults write com.apple.speech.voice.prefs 'SelectedVoiceID' -int 745
/usr/bin/defaults write com.apple.speech.voice.prefs 'SelectedVoiceName' -string 'Samantha'
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.Alex' 0
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.Bruce' 0
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.Fred' 0
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.Kathy' 0
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.Vicki' 0
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.Victoria' 0
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.jill.premium' 1
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.samantha.premium' 1
/usr/bin/defaults write com.apple.speech.voice.prefs 'VisibleIdentifiers' -dict-add 'com.apple.speech.synthesis.voice.tom.premium' 1
### Time Machine ###
### Startup Disk ###
### Finder ###
/usr/bin/defaults write com.apple.finder 'NewWindowTarget' -string 'PfHm'
/usr/bin/defaults write com.apple.finder 'QuitMenuItem' -bool true
/usr/bin/killall Finder
### Applications / iTunes ###
/usr/bin/defaults write com.apple.iTunes 'disablePing' -bool true
/usr/bin/defaults write com.apple.iTunes 'hide-ping-dropdown' -bool true
/usr/bin/defaults write com.apple.iTunes 'show-store-link-arrows' -bool true
/usr/bin/defaults write com.apple.iTunes 'invertStoreLinks' -bool true
/usr/bin/defaults write com.apple.iTunes 'allow-half-stars' -bool true
### Applications / Mail ###
/usr/bin/defaults write com.apple.mail 'PreferPlainText' -bool true
/usr/bin/defaults write com.apple.mail 'DisableReplyAnimations' -bool true
/usr/bin/defaults write com.apple.mail 'DisableSendAnimations' -bool true
### Applications / Safari ###
/usr/bin/defaults write com.apple.Safari 'ShowStatusBar' -bool true
### Applications / Safari / General ###
/usr/bin/defaults write com.apple.Safari 'NewWindowBehavior' -int 1
/usr/bin/defaults write com.apple.Safari 'NewTabBehavior' -int 1
/usr/bin/defaults write com.apple.Safari 'HomePage' -string ''
/usr/bin/defaults write com.apple.Safari 'AutoOpenSafeDownloads' -bool false
/usr/bin/defaults write com.apple.Safari 'LastDisplayedWelcomePageVersionString' -string 4.0
/usr/bin/defaults write com.apple.Safari 'DidAddReadingListToBookmarksBar' -bool true
/usr/bin/defaults write com.apple.Safari 'DidMigrateNewBookmarkSheetToReadingListDefault' -bool true
/usr/bin/defaults write com.apple.Safari 'ConvertedNewWindowBehaviorForTopSites' -bool true
/usr/bin/defaults write com.apple.Safari 'BookmarksToolbarProxiesWereConvertedForSafari4' -bool true
### Applications / Safari / Bookmarks ###
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.Safari.plist" -c 'Delete ProxiesInBookmarksBar array' > /dev/null 2>&1
/usr/libexec/PlistBuddy "$HOME/Library/Preferences/com.apple.Safari.plist" -c 'Add ProxiesInBookmarksBar array'
### Applications / Safari / Tabs ###
/usr/bin/defaults write com.apple.Safari 'TabCreationPolicy' -int 2
/usr/bin/defaults write com.apple.Safari 'CommandClickMakesTabs' -bool true
### Applications / Safari / Advanced ###
/usr/bin/defaults write com.apple.Safari 'IncludeDevelopMenu' -bool true
### CrashReporter ###
/usr/bin/defaults write com.apple.CrashReporter 'DialogType' -string 'none'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment