#!/usr/bin/env bash # Master macOS setup script set -euo pipefail MACOS_DIR="$HOME/dotfiles/macos" # Colors GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' echo -e "${BLUE}macOS System Setup${NC}" echo "==================" echo "" # Function to ask yes/no ask() { while true; do read -p "$1 (y/n) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]]; then return 0 elif [[ $REPLY =~ ^[Nn]$ ]]; then return 1 fi done } # Backup current settings if ask "Backup current macOS settings first?"; then echo -e "${YELLOW}Creating backup...${NC}" bash "$MACOS_DIR/backup-defaults.sh" echo "" fi # Apply system defaults echo -e "${YELLOW}Choose how to apply system defaults:${NC}" echo "1) Interactive mode (recommended for first time)" echo "2) Apply all defaults automatically" echo "3) Skip defaults" read -p "Choice (1-3): " -n 1 -r echo "" case $REPLY in 1) bash "$MACOS_DIR/defaults-interactive.sh" ;; 2) bash "$MACOS_DIR/defaults.sh" ;; *) echo "Skipping defaults..." ;; esac echo "" # Security settings if ask "Apply security settings?"; then echo -e "${YELLOW}Applying security settings...${NC}" bash "$MACOS_DIR/security.sh" echo "" fi # Keyboard shortcuts if ask "Set up keyboard shortcuts?"; then echo -e "${YELLOW}Setting up keyboard shortcuts...${NC}" bash "$MACOS_DIR/keyboard-shortcuts.sh" echo "" fi echo -e "${GREEN}macOS setup complete!${NC}" echo "" echo "Summary of what was configured:" echo "- System defaults (UI, Finder, Dock, etc.)" echo "- Security settings (firewall, privacy, etc.)" echo "- Keyboard shortcuts" echo "" echo "Next steps:" echo "1. Log out and back in for all changes to take effect" echo "2. Review security settings in System Preferences" echo "3. Configure any remaining manual settings" echo "4. Install applications: brew bundle install"