6

I never use the keyboard shortcuts for moving spaces in mission control, and they happen to conflict with some other settings I have. I have an automated script that sets up my Mac and I'd like to disable all the defaults keybindings for Mission Control programmatically.

5
  • Is there any particular reason you need to do this programatically, rather than just from the Keyboard control panel?
    – Tetsujin
    Commented Dec 2, 2018 at 9:18
  • 1
    @Tetsujin because I have a script that sets up my Macs (more than one) and if I need to rebuild them I'd like everything to work properly after running the script. I'd forget this manual step and it would cause problems.
    – Nathan
    Commented Dec 2, 2018 at 9:47
  • 3
    What's with the down vote?
    – Nathan
    Commented Dec 2, 2018 at 14:28
  • 2
    @ Nathan - you'll never know, votes are anonymous - & whoever downvoted won't be notified of your comment... only me, as the previous commenter. [It wasn't me, btw.] A guess may be that the clarification prompted by my question really ought to be edited into the original question, so it stands whole & complete.
    – Tetsujin
    Commented Dec 2, 2018 at 17:00
  • @Tetsujin lol, I wasn't suggesting it was you. Just thought it odd. As for clarification on the reason for this post, I actually thought I did specify it in my question.
    – Nathan
    Commented Dec 2, 2018 at 17:27

1 Answer 1

10

I was able to figure this out. Here is what I did:

Step 1

Generate a file with your current default settings:

defaults read com.apple.symbolichotkeys.plist AppleSymbolicHotKeys > file_a

Step 2

Manually change the settings you want in System Preferences > Keyboard > Shortcuts

Step 3

Generate a new comparison file from settings after making your change:

defaults read com.apple.symbolichotkeys.plist AppleSymbolicHotKeys > file_b

Step 4

Diff compare the two files:

diff file_a file_b

Step 5

Disable only the keys that appeared in the diff, example:

defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 82 "
  <dict>
    <key>enabled</key><false/>
    <key>value</key><dict>
      <key>type</key><string>standard</string>
      <key>parameters</key>
      <array>
        <integer>65535</integer>
        <integer>124</integer>
        <integer>8781824</integer>
      </array>
    </dict>
  </dict>
"

You must log in to answer this question.

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