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
Step 3 – Run command
In your shell, run
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!