#!/usr/bin/env bash set -ex ######################################################################### # Keyboard ######################################################################### # Repeat keys while held down defaults write -g ApplePressAndHoldEnabled -bool FALSE # Repeat keys without delay defaults write -g InitialKeyRepeat -float 15 # Fastest key repeat rate defaults write -g KeyRepeat -float 2 # Use F1, F2, etc. keys as standard function keys defaults write -g com.apple.keyboard.fnState -bool TRUE ######################################################################### # Finder ######################################################################### # Open new window in home directory defaults write com.apple.finder NewWindowTarget PfHm # Show breadcrumbs defaults write com.apple.finder ShowPathbar 1 # Show status bar (file count and available storage) defaults write com.apple.finder ShowStatusBar 1 # Show all filename extensions defaults write -g AppleShowAllExtensions 1 # No warning before changing an extension defaults write com.apple.finder FXEnableExtensionChangeWarning 0 # No warning before emptying the Trash defaults write com.apple.finder WarnOnEmptyTrash 0 # Remove items from the Trash after 30 days defaults write com.apple.finder FXRemoveOldTrashItems 1 # Search the current folder defaults write com.apple.finder FXDefaultSearchScope SCcf # Show hard disks, external disks, removables, and servers on desktop defaults write com.apple.finder ShowHardDrivesOnDesktop 1 defaults write com.apple.finder ShowExternalHardDrivesOnDesktop 1 defaults write com.apple.finder ShowRemovableMediaOnDesktop 1 defaults write com.apple.finder ShowMountedServersOnDesktop 1 ######################################################################### # Desktop & Dock ######################################################################### # Automatically hide and show the Dock defaults write com.apple.dock autohide -bool TRUE # Remove auto-hide delay defaults write com.apple.dock autohide-delay -float 0 # Animate auto-hide (500ms) defaults write com.apple.dock autohide-time-modifier -float 0.5 # Position Dock on the left defaults write com.apple.dock orientation left # Small icons in Dock defaults write com.apple.dock tilesize -int 36 # Hide suggested and recent apps in Dock defaults write com.apple.dock show-recents -bool FALSE # Customize Hot Corners # # Allowed corner values: # 1: - (Do nothing) # 2: Mission Control # 3: Application Windows # 4: Desktop # 5: Start Screen Saver # 5: Disable Screen Saver # 10: Put Display to Sleep # 11: Apps # 12: Notification Center # 13: Lock Screen # 14: Quick Note defaults write com.apple.dock wvous-bl-corner -int 1 defaults write com.apple.dock wvous-bl-modifier -int 0 defaults write com.apple.dock wvous-br-corner -int 1 defaults write com.apple.dock wvous-br-modifier -int 0 defaults write com.apple.dock wvous-tl-corner -int 1 defaults write com.apple.dock wvous-tl-modifier -int 0 defaults write com.apple.dock wvous-tr-corner -int 1 defaults write com.apple.dock wvous-tr-modifier -int 0 # Hide widgets on desktop defaults write com.apple.WindowManager StandardHideWidgets -bool TRUE ######################################################################### # Spotlight ######################################################################### # Exclude selected results from Spotlight defaults write com.apple.Spotlight EnabledPreferenceRules -array \ 'System.files' \ 'System.folders' \ 'System.iphoneApps' \ 'com.apple.AddressBook' \ 'com.apple.AppStore' \ 'com.apple.MobileSMS' \ 'com.apple.Notes' \ 'com.apple.Photos' \ 'com.apple.Safari' \ 'com.apple.VoiceMemos' \ 'com.apple.clock' \ 'com.apple.freeform' \ 'com.apple.iBooksX' \ 'com.apple.iCal' \ 'com.apple.iWork.Keynote' \ 'com.apple.iWork.Numbers' \ 'com.apple.mail' \ 'com.apple.mobilephone' \ 'com.apple.news' \ 'com.apple.podcasts' \ 'com.apple.reminders' \ 'com.apple.shortcuts' \ 'com.apple.systempreferences' \ 'com.apple.tips' \ ; ######################################################################### # Siri ######################################################################### # Turn off Siri defaults write com.apple.assistant.support 'Assistant Enabled' -bool FALSE # Do not activate Siri by voice defaults write com.apple.Siri VoiceTriggerUserEnabled -bool FALSE ######################################################################### # Safari ######################################################################### # Do not close tabs automatically defaults write com.apple.Safari CloseTabsAutomatically -int 0 # Remove history items manually defaults write com.apple.Safari HistoryAgeInDaysLimit -int 365000 # Command-click opens a new tab defaults write com.apple.Safari CommandClickMakesTabs -bool TRUE # Use Command-1 through Command-9 to switch tabs defaults write com.apple.Safari Command1Through9SwitchesTabs -bool TRUE # Search with DuckDuckGo defaults write com.apple.Safari SearchProviderShortName DuckDuckGo # Private Browsing uses the same search engine as normal browsing defaults write com.apple.Safari PrivateSearchEngineUsesNormalSearchEngineToggle -bool TRUE # Warn before connecting to a website over HTTP defaults write com.apple.Safari UseHTTPSOnly -bool TRUE # Disable ad measurement defaults write com.apple.Safari WebKitPreferences.privateClickMeasurementEnabled -bool FALSE # Show full website address defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool TRUE # Show features for web developers defaults write com.apple.Safari IncludeDevelopMenu -bool TRUE ######################################################################### # Terminal ######################################################################### # Enable secure keyboard entry defaults write com.apple.Terminal SecureKeyboardEntry -bool TRUE # Use Command-1 through Command-9 to switch tabs defaults write com.apple.Terminal Command1Through9SwitchesTabs -bool TRUE # Basic profile PLIST="$HOME/Library/Preferences/com.apple.Terminal.plist" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:Bell false" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:VisualBell false" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:columnCount 160" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:rowCount 40" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:FontAntialias true" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:FontWidthSpacing 1" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:FontHeightSpacing 1.5" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:shellExitAction 1" "$PLIST" /usr/libexec/PlistBuddy -c "Set :'Window Settings':Basic:ShouldRestoreContent false" "$PLIST" ######################################################################### # Close affected applications ######################################################################### apps=("Finder" "Dock" "Spotlight" "Siri" "Safari" "Terminal" "System Settings") for appname in "${apps[@]}"; do killall -q "$appname" || true done echo "macOS configured successfully. Some settings require a reboot to take effect."