I don’t like the Spotlight indexing and search that is included in Mac OS X. I use Quicksilver instead but have been procrastinating turning off Spotlight.
Well I finally got around to disabling Spotlight and wanted to go about it in a safe way. I came across too many forum posts doing dangerous things to disable Spotlight. I also wanted and easy way to remove it from the menu bar. Below are aliases I added to my bash profile to conveniently enable and disable spotlight. I am not a bash scripting master, so feedback is welcome and appreciated.
Step 1 – Add aliases
Open your bash profile (location: ~/.bash_profile ) and add these lines:
alias spotlight-off='sudo mdutil -a -i off && sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/' alias spotlight-on='sudo mdutil -a -i on && sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/'
Step 2 – Source your bash profile
source ~/.bash_profile
Step 3 – Run command
In your shell, run
$ spotlight-off
Step 4 – Restart SystemUIServer Process
$ ps aux | grep SystemUIServer.app # take note of the PID which is the first number you will see $ kill -HUP <insert PID here>
You could potentially restart your computer instead of performing Step 4, but that is inconvenient. Let me know if you have any comments or a nice way to include everything in one script. I didn’t have time to condense this process further.
If you enjoyed this post, make sure you subscribe to my RSS feed!










2 Comments
Thanks! Exactly what I was looking for, and you even made Bash aliass for me.
For your step 4, you can use ‘killall SystemUIServer’ rather than greping the pid and using kill.
My next step is to bind QuickSilver to a keyboard shortcut so I can launch it sans spotlight when it crashes. I plan to use the program titled “This Service” to add the script to the Services menu.
Below a list of interesting links that I found this week: Interaction: Test Usability By Embracing Other