3

I am trying to make configuration of a new macOS system as automated as possible. I use Alfred and prefer to use Cmd-Space to trigger the Alfred window instead of the install default of calling off to Spotlight.

There is a similar question about disabling Spotlight to re-use the hotkey for Alfred How to disable spotlight for Alfred however it relies on the GUI and navigating System Preferences. I'd really like to be able to automate this as part of bootstrapping via yadm which I use to configure as much of the machine as possible to a preferred working state.

1 Answer 1

1

If you want to turn off the Spotlight hotkeys on your Mac, you can use this simple command in the Terminal:

/usr/libexec/PlistBuddy -c "Set ':AppleSymbolicHotKeys:64:enabled' 'false'" "$HOME/Library/Preferences/com.apple.symbolichotkeys.plist"

This command uses a handy tool called PlistBuddy to change the com.apple.symbolichotkeys.plist file, which stores the settings for the Spotlight hotkeys.

By the way, I've created a cool tool called plist that helps you manage macOS preference files (plist files). This tool watches for changes in plist files and gives you PlistBuddy commands when you update preferences in macOS or apps.

You can check out this tool in this livestream, where I used it to generate the command to turn off the Spotlight hotkeys. And that's how I'd turn the Spotlight on myself.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .