Created
February 7, 2026 12:44
-
-
Save yarinsa/e53f2ead9845dfa639fd3a76e6c5fc6a to your computer and use it in GitHub Desktop.
macOS defaults setup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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