Skip to content

Instantly share code, notes, and snippets.

@ulasozguler
Created February 4, 2017 18:58
Show Gist options
  • Select an option

  • Save ulasozguler/d205281050babc2ccc0f6889d7f4db45 to your computer and use it in GitHub Desktop.

Select an option

Save ulasozguler/d205281050babc2ccc0f6889d7f4db45 to your computer and use it in GitHub Desktop.
Remove spotlight icon from menu bar.
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
@om2c0de

om2c0de commented Mar 1, 2020

Copy link
Copy Markdown

Works great!! Thank you !!!

@cytown

cytown commented Jul 27, 2020

Copy link
Copy Markdown

Not working in Catalina, any idea?

@JeremyCavanagh

Copy link
Copy Markdown

Thank you for your knowledge and work. This is a fantastic non-app it works brilliantly on macOS Mojave 10.14.6. I never, ever use Spotlight it just consumes too many resources and slows everything down just to give the impression of how fast it works, at the cost to all other apps! Anyway, there are perfectly good apps, like 'Find Any File' and 'EasyFind' both free, that do the job better.

@ilovefood2

Copy link
Copy Markdown

i'm on catalina too, any other options for 10.15?

@jivanpal

jivanpal commented Sep 9, 2020

Copy link
Copy Markdown

Works perfectly for me in Catalina 10.15.6 (19G2021), thanks!

@thanhbinh84

Copy link
Copy Markdown

Spotlight: Operation not permitted
10.15.5 (19F101)
Entered correct password.

@jivanpal

Copy link
Copy Markdown

@thanhbinh84, I had this, too; you need to remount /System with write privileges: sudo mount -uw / will remount everything as such. I'm pretty sure that SIP must be disabled in order to do this.

@MrNotch9

Copy link
Copy Markdown

How do I undo the effects of this code?

@jivanpal

jivanpal commented Oct 17, 2020

Copy link
Copy Markdown

@MrNotch9, in the folder /System/Library/CoreServices/Spotlight.app/Contents/MacOS, the script copies Spotlight to Spotlight.bak, and then modifies Spotlight. To reverse the changes, just rename Spotlight.bak back to Spotlight, and then restart Spotlight, e.g.:

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

@Mancerrss

Copy link
Copy Markdown

I need SIP disabled for this right?

@jivanpal

jivanpal commented Mar 22, 2021

Copy link
Copy Markdown

@Mancerrss, yes, SIP must be disabled to modify the contents of /System. Also, see here for an explanation of why sudo mount -uw / is needed once booted on Catalina and later: https://apple.stackexchange.com/a/375611

@dmattera

Copy link
Copy Markdown

does this disable Spotlight completely or just remove the icon from the menubar? I'd like only to remove the icon but continue using Spotlight as I only ever activate it via keyboard shortcut (Cmd+Space).

@jivanpal

Copy link
Copy Markdown

@dmattera, the latter; Spotlight remains functional.

@liuziangexit

Copy link
Copy Markdown

works like a charm

ghost commented Oct 15, 2022

Copy link
Copy Markdown

if having issues on catalina:::

disable system integrity protection, then reboot

then unmount the drive

sudo mount -uw /

then run the above

@jivanpal

Copy link
Copy Markdown

@steveaolsen That was already mentioned in the comments before you 🙂

@juzipeek

Copy link
Copy Markdown

Catalina 10.15.7 work ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment