Skip to content

Instantly share code, notes, and snippets.

@yarinsa
Created February 7, 2026 12:44
Show Gist options
  • Select an option

  • Save yarinsa/e53f2ead9845dfa639fd3a76e6c5fc6a to your computer and use it in GitHub Desktop.

Select an option

Save yarinsa/e53f2ead9845dfa639fd3a76e6c5fc6a to your computer and use it in GitHub Desktop.
macOS defaults setup script
#!/bin/bash
# macOS Defaults Setup Script
# Run this on your new machine to restore settings
echo "πŸ”§ Configuring macOS defaults..."
# ============================================
# Screenshots
# ============================================
echo "πŸ“Έ Setting up screenshots..."
mkdir -p ~/Downloads/screenshots
defaults write com.apple.screencapture location -string "~/Downloads/screenshots"
defaults write com.apple.screencapture showsClicks -bool true
defaults write com.apple.screencapture style -string "display"
# ============================================
# Dock
# ============================================
echo "🚒 Configuring Dock..."
defaults write com.apple.dock autohide -bool true
# ============================================
# Finder
# ============================================
echo "πŸ“ Configuring Finder..."
# Use icon view by default
defaults write com.apple.finder FXPreferredViewStyle -string "icnv"
# New window opens in home folder (PfAF = Applications Folder, use PfHm for Home)
defaults write com.apple.finder NewWindowTarget -string "PfAF"
# ============================================
# Menu Bar Clock
# ============================================
echo "πŸ• Configuring menu bar clock..."
defaults write com.apple.menuextra.clock ShowAMPM -bool true
defaults write com.apple.menuextra.clock ShowDate -bool false
defaults write com.apple.menuextra.clock ShowDayOfWeek -bool true
# ============================================
# Global Settings
# ============================================
echo "🌍 Configuring global settings..."
# Disable swipe navigation with scrolls (two-finger swipe back/forward)
defaults write NSGlobalDomain AppleEnableSwipeNavigateWithScrolls -bool false
# Auto switch between light/dark mode
defaults write NSGlobalDomain AppleInterfaceStyleSwitchesAutomatically -bool true
# Don't minimize on double-click
defaults write NSGlobalDomain AppleMiniaturizeOnDoubleClick -bool false
# ============================================
# Text Replacements (Shortcuts)
# ============================================
echo "⌨️ Note: Text replacements need to be set up manually in System Settings > Keyboard > Text Replacements"
echo " Your replacements:"
echo " - ww β†’ yarin.sasson@transmitsecurity.com"
echo " - @@ β†’ yarinsasson2@gmail.com"
# ============================================
# Restart affected apps
# ============================================
echo ""
echo "πŸ”„ Restarting affected services..."
killall Dock 2>/dev/null
killall Finder 2>/dev/null
killall SystemUIServer 2>/dev/null
echo ""
echo "βœ… Done! Some changes may require logout/restart to take effect."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment