Skip to content

Instantly share code, notes, and snippets.

@einfallstoll
Created June 30, 2015 13:30
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save einfallstoll/d2fcf8362e4cd4758035 to your computer and use it in GitHub Desktop.
Save einfallstoll/d2fcf8362e4cd4758035 to your computer and use it in GitHub Desktop.
Reset Spotlight Location (Fix for OS X 10.11 El Capitan)

Installation for GUI Users

  1. Right click the file and choose information and choose to always open this file with Terminal.app

  2. Go to the Terminal.app and do something like this chmod 744 Reset Spotlight.sh

  3. There you go, you can now double click it so reset the Spotlight location

  4. Optional: Uncomment line for the useCount to prevent Spotlight to forget that you already used it

#!/bin/sh
# Delete all information saved by Spotlight
defaults delete com.apple.Spotlight
# Restart Spotlight
killall Spotlight
# Uncomment to prevent Spotlight to always introduce itself as new
# defaults write com.apple.Spotlight useCount 5
exit 0
@joeyhoer
Copy link

I would suggest:

echo LastMove{X,Y,Valid} | xargs -n1 -I {} defaults delete com.apple.Spotlight "{}" 2>/dev/null && killall Spotlight

This will only remove the window position settings, while preserving the other settings.

@jamesnine
Copy link

This one line command does the trick w/out restarting Spotlight and erasing all your settings (tested on OS X 10.11 GM):

defaults delete com.apple.Spotlight userHasMovedWindow

If you moved AND resized the Spotlight window, you will need to delete another parameter, and restart Spotlight:

defaults delete com.apple.Spotlight userHasMovedWindow;defaults delete com.apple.Spotlight windowHeight;killAll Spotlight

@glyph
Copy link

glyph commented Jan 9, 2016

Thank you for this! I just ran into this exact situation and it was a big help to run across this gist.

@superpixel
Copy link

Just hold down on the Spotlight icon in the menu bar and the position of the window will reset to its default location after 2 seconds.

@aaronrogers
Copy link

Wow! @superpixel, that's awesome.

@YVE-Development
Copy link

You can just move it with your cursor…

@chesterbr
Copy link

Thank you @einfallstoll for writing this, and @YuriEnrico for noticing you can move it with the cursor (given the lack of visual affordances, I'd never think it would me movable) 😄

@joeljuca
Copy link

joeljuca commented Jun 8, 2018

Wow! It was really helpful! Thanks a lot! <3

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