Add disable spotlight

This commit is contained in:
Yan Lin 2025-08-23 22:06:30 +08:00
parent d1e8fe0a0a
commit f7a36ce662
2 changed files with 34 additions and 0 deletions

View file

@ -12,5 +12,15 @@
echo "Setting menu bar spacing preferences..."
sudo -u yanlin defaults -currentHost write -globalDomain NSStatusItemSpacing -int 10
sudo -u yanlin defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 5
echo "Disabling Spotlight indexing..."
# Disable Spotlight indexing for all volumes
# WARNING: This will break Mail.app search, Time Machine, and other features
# To re-enable: sudo mdutil -a -i on
sudo mdutil -a -i off
# Erase existing Spotlight index to free up disk space
echo "Erasing existing Spotlight index..."
sudo mdutil -E /
'';
}