Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Feature spotlightprefs #174

Closed
wants to merge 3 commits into from

3 participants

@windgazer

Spotlight prefs as you had them in Issue #91 plus a quick trick to keep Spotlight's hands off any external drives.

@vitorgalvao

Although I've never seen a real alternative to sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search, I'd argue it's not an ideal solution. If you Repair Disk Permissions from within Disk Utility, it'll revert the permissions back, and show the icon again.

@windgazer

Fair point, but apart from running Bartender.app, I wouldn't know of any other way. Perhaps instead an alias to show/hide would do the trick?

@vitorgalvao

Yes, perhaps that would be more effective than having to go through the script again every time you repair disk permissions, to find that line.
Like I said, I also never found a better way than the one you suggested. Which is a shame, since spotlight is great, but not if you just need to use its database with a better alternative (Alfred, Quicksilver).

@mathiasbynens

+1 on moving that code to an alias. Ideally .osx would only include the defaults write … command (+ killall mds at the bottom).

@mathiasbynens mathiasbynens commented on the diff
@@ -452,6 +452,25 @@ defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
hash tmutil &> /dev/null && sudo tmutil disablelocal
###############################################################################
+# Spotlight #
+###############################################################################
+
+# Hide Spotlight tray-icon (and subsequent helper)
+#sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
+# Disable Spotlight indexing for any Volume that gets mounted and has not yet
+# been indexed before.
+# Use 'sudo mdutil -i off /Volumes/Backup\ Drive' to cleanup any volume
+sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions '("/Volumes")'
@mathiasbynens Owner

If I pull this in I’ll be changing this line to:

sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mathiasbynens mathiasbynens referenced this pull request from a commit
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
6806bf4
@mathiasbynens

Thanks!

@jtyost2 jtyost2 referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@seandw seandw referenced this pull request from a commit
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
a25845c
@mrkd mrkd referenced this pull request from a commit in mrkd/dotfiles
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
3660a36
@MarcelloDiSimone MarcelloDiSimone referenced this pull request from a commit
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
acdfb82
@thorsten thorsten referenced this pull request from a commit in thorsten/dotfiles
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
858190e
@dmcass dmcass referenced this pull request from a commit in dmcass/windows-dotfiles
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
8c98c18
@natchiketa natchiketa referenced this pull request from a commit in natchiketa/dotfiles
@windgazer windgazer .osx: Add Spotlight settings
Closes #91 and #174.
493d959
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 19 additions and 0 deletions.
  1. +19 −0 .osx
View
19 .osx
@@ -452,6 +452,25 @@ defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
hash tmutil &> /dev/null && sudo tmutil disablelocal
###############################################################################
+# Spotlight #
+###############################################################################
+
+# Hide Spotlight tray-icon (and subsequent helper)
+#sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
+# Disable Spotlight indexing for any Volume that gets mounted and has not yet
+# been indexed before.
+# Use 'sudo mdutil -i off /Volumes/Backup\ Drive' to cleanup any volume
+sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions '("/Volumes")'
@mathiasbynens Owner

If I pull this in I’ll be changing this line to:

sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+# Changing indexing order and disabling some uninteresting items.
+defaults write com.apple.spotlight orderedItems '({"enabled" = 1;"name" = "APPLICATIONS";},{"enabled" = 1;"name" = "SYSTEM_PREFS";},{"enabled" = 1;"name" = "DIRECTORIES";},{"enabled" = 1;"name" = "PDF";},{"enabled" = 1;"name" = "FONTS";},{"enabled" = 0;"name" = "DOCUMENTS";},{"enabled" = 0;"name" = "MESSAGES";},{"enabled" = 0;"name" = "CONTACT";},{"enabled" = 0;"name" = "EVENT_TODO";},{"enabled" = 0;"name" = "IMAGES";},{"enabled" = 0;"name" = "BOOKMARKS";},{"enabled" = 0;"name" = "MUSIC";},{"enabled" = 0;"name" = "MOVIES";},{"enabled" = 0;"name" = "PRESENTATIONS";},{"enabled" = 0;"name" = "SPREADSHEETS";},{"enabled" = 0;"name" = "SOURCE";})'
+# Load new settings before redoing the index
+killall mds
+# Make sure indexing is enabled for main Volume
+sudo mdutil -i on /
+# Redo the index from scratch
+sudo mdutil -E /
+
+###############################################################################
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
###############################################################################
Something went wrong with that request. Please try again.