How do I hide the Spotlight icon on Yosemite, but keep the Spotlight functionality?

I use Spotlight in OS X, and I have long disliked its attachment to the menu bar.

Now, in Yosemite, Spotlight shows up as an overlay in the middle of the screen when summoned, much like other launcher utilities like Quicksilver or Alfred. But the Spotlight icon is still stuck in my menubar, even though clicking it now shows a totally detached overlay.

The traditional way to disable the search icon (chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search) also disables Spotlight completely. I want to keep Spotlight functionality, but kill the (now useless) menubar icon, since I can summon Spotlight with Cmd+Space.

I've also tried Bartender, which works but is both pricey ($15 to remove an icon!) and quirky (it takes a while to startup, so my menu bar ends up shifting around for up to a minute after logging in)

What's the best way to remove the Spotlight icon?


Solution 1:

So I got fed up with this and decided to fix it the hard way.

I found out where Spotlight initializes the status bar item, and I just patched the status bar size to zero. This requires editing the Spotlight binary. (Note that Search.bundle is just the little stub that gets loaded into SystemUIServer to allow Spotlight.app to control the status bar).

You'll have to use the Terminal to execute some commands.

For OS X 10.10 (Yosemite):

cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo cp Spotlight Spotlight.bak
sudo perl -pi -e 's|(\x48\xb8\x00\x00\x00\x00\x00\x00)\x42\x40(\x48\x89\x47\x10\x48\xB8\x00\x00\x00\x00\x00\x00\x36\x40)|$1\x00\x00$2|sg' Spotlight
cmp -l Spotlight Spotlight.bak 
sudo codesign -f -s - Spotlight
sudo killall Spotlight

For OS X 10.11 (El Capitan):

cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo cp Spotlight Spotlight.bak
sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight
cmp -l Spotlight Spotlight.bak 
sudo codesign -f -s - Spotlight
sudo killall Spotlight

The cmp -l line should print out something like the following:

248855   0 102
248856   0 100

If it prints out nothing, then the patch failed. I have tested this on OS X 10.10.3 (Yosemite) and OS X 10.11.5 (El Capitan; SIP off).

What this patch is doing is replacing the status bar width value (36.0, or 0000000000004240 in floating-point hex) with zero, so that when the status bar item is loaded it simply renders with a width of zero, i.e. it is invisible and doesn't affect the layout of the bar.

Screenshot before doing this hack:

before hack

Screenshot after doing this hack:

after hack

Menu icon is gone but Cmd+Space continues to work.


To revert, do the following:

cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo mv Spotlight.bak Spotlight
sudo killall Spotlight

Solution 2:

I'd recommend using the utility app called Bartender. http://www.macbartender.com

This is a handy utility to manage and change the way menu bar icons are displayed. You can leave them in the menu bar, have them dropped down into the bartender bar which itself is opened via a small icon in your menu bar, but can hold any of the icons normally in the menu bar, or hide the icon altogether.

You can see a screenshot here:

enter image description here

Solution 3:

I ended up removing the icon and Spotlight Search functionality and now I use Alfred instead ; it's faster and it is free (with paying extension that you mostly don't need).

Removing the Spotlight visible application (and the icon) the indexation services are not stopped, only the graphical user interface is stopped i.e. both the icon in the top menu top bar and the Search window when + Space. This is why you need another application to access these indexes, such as Alfred.

So the following command that changes the permission to make Search not executable.

sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

as said it does not completely disable spotlight, it only removes a the graphical user interface of Spotlight.

Logging out and in may be sufficient, if not just reboot.


You can revert it with this command

sudo chmod 755 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

Same here you have to log out or restart.

This method is still working with 10.10.3.


This method is probably not exactly what the question asked but it has the merit to limit the manipulation screw ups. Just changing the files permissions is way easier than changing the binary of a program. to just to don't show the Spotlight icon the binary of Spotlight.