How do I change Mission Control shortcuts from the command line?

Solution 1:

This is not a direct answer although I hope the information presented herein will help you get to a direct answer.

I can tell you what changes in which file when you change the default keyboard shortcut for Mission Control from Control-Up Arrow to Control-Option-Up Arrow. It's the "Item 2 Number" of the "parameters" Array in the "value" Dictionary of the "32" Dictionary and "34" Dictionary of the "AppleSymbolicHotKeys" Dictionary in the /Users/$USER/Library/Preferences/com.apple.symbolichotkeys.plist file.

Here's a defaults read representation of the com.apple.symbolichotkeys.plist file structure as it relates to the changes made under the defined circumstances above.

Mission Control with the default of Control-Up Arrow

{
    AppleSymbolicHotKeys =     {
        32 =         {
            enabled = 1;
            value =             {
                parameters =                 (
                    65535,
                    126,
                    2359296
                );
                type = standard;
            };
        };
        34 =         {
            enabled = 1;
            value =             {
                parameters =                 (
                    65535,
                    126,
                    2490368
                );
                type = standard;
            };
        };
    };
}

Mission Control changed to Control-Option-Up Arrow

{
    AppleSymbolicHotKeys =     {
        32 =         {
            enabled = 1;
            value =             {
                parameters =                 (
                    65535,
                    126,
                    2883584
                );
                type = standard;
            };
        };
        34 =         {
            enabled = 1;
            value =             {
                parameters =                 (
                    65535,
                    126,
                    3014656
                );
                type = standard;
            };
        };
    };
}

The BUGS section of the defaults man page says:

Defaults can be structured in very complex ways, making it difficult for the user to enter them with this command.

And this is a perfect example as it will be a very complex command line using defaults to write the target values to the target array elements, if it's even doable. Just an FYI... If you're going to attempt to do a defaults write com.apple.symbolichotkeys ... command make sure you've backed up the target file first.

The other option is to use an AppleScript to change the settings by navigating the System Preferences GUI and that too will be a little complex in comparison to setting a top level object, which the target here is not. I'm not even sure it's doable however if I needed an automated way then I'd figure it out however I do no have the time to figure out either method, sorry.

At least you now know what changes where and from there you may be able to either figure it out on your own or get additional help with knowing this little bit more.

Here's a clipped image in Xcode of the com.apple.symbolichotkeys.plist file.

enter image description here

BTW I trapped the changes using a third party utility that logged the filesystem changes and then converted that information to a more human readable output to provide this information.