#!/bin/bash

# ==============================================
# Отключаем Spotlight (индексирование и поиск)
# ==============================================
echo "[1/5] Disabling Spotlight..."
sudo mdutil -a -i off                          # Выключаем индексирование
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist 2>/dev/null || echo "Spotlight daemon already unloaded"

# ==============================================
# Отключаем Siri и связанные службы
# ==============================================
echo "[2/5] Disabling Siri..."
sudo launchctl disable system/com.apple.sirid   # Siri daemon
sudo launchctl disable system/com.apple.Siri.agent
defaults write com.apple.assistant.support "Assistant Enabled" -bool false
defaults write com.apple.Siri "StatusMenuVisible" -bool false

# ==============================================
# Отключаем Handoff, AirDrop (не нужно в VM)
# ==============================================
echo "[3/5] Disabling Handoff/AirDrop..."
defaults write ~/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist ActivityAdvertisingAllowed -bool false
defaults write com.apple.NetworkBrowser DisableAirDrop -bool true

# ==============================================
# Убиваем ненужные демоны (Analytics, Diagnostics)
# ==============================================
echo "[4/5] Disabling Analytics & Diagnostics..."
sudo launchctl disable system/com.apple.analyticsd       # Analytics
sudo launchctl disable system/com.apple.diagnosticd      # Diagnostics
sudo launchctl disable system/com.apple.tccd             # Privacy Controls (не всегда нужно)

# ==============================================
# Отключаем Time Machine (если не используется)
# ==============================================
echo "[5/5] Disabling Time Machine..."
sudo tmutil disable                                      # Выключаем автоматические бэкапы

# ==============================================
# Дополнительно: Отключаем автоматические обновления
# ==============================================
sudo softwareupdate --schedule off
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool false
defaults write com.apple.SoftwareUpdate AutomaticDownload -bool false
defaults write com.apple.commerce AutoUpdate -bool false

# Дополнительно: Отключаем Notification Center 
sudo launchctl disable system/com.apple.notificationcenterui

#Universal Control
defaults write com.apple.universalcontrol Disable -bool true

echo "✅ Done! Some changes may require a reboot."





















