How to set system keyboard shortcuts via command line? I'm used to have some keyboard shortcut remapping for menu items via Apple's system preferences -&gt; keyboard pane. Some globals, most of them application specific.
What was working in the past (High Sierra if I'm not mistaken) was something like this:
defaults write com.googlecode.iterm2 NSUserKeyEquivalents -dict-add &quot;Advanced Paste…&quot; -string &quot;@~^v&quot;

Running
defaults read com.googlecode.iterm2 NSUserKeyEquivalents

shows that it has been set, but neither System Preferences (after restart) shows it nor the menu item in iTerm2.
If I enter it manually in System Preferences, the read command reveals the same (after deleting it before) and the new shortcut is visible in the menu.
This seems to be the case on Catalina for every application and shortcut I previously added via a setup script, e.g. for apps like Safari, Google Chrome, etc.
I also tried
defaults write -app iTerm ...

but it has the exact same effect.
Did anything change on (at least) Catalina? What's the correct way nowadays to do it?
Figured it out. You have to add the application you want to modify keys for to com.apple.universalaccess.
defaults write com.apple.universalaccess com.apple.custommenu.apps -array-add &quot;com.googlecode.iterm2&quot;

or if all keyboard equivalents are set via one file, you can also write the full list at once
defaults write com.apple.universalaccess com.apple.custommenu.apps -array &quot;com.googlecode.iterm2&quot; &quot;com.apple.Safari&quot; &quot;com.google.Chrome&quot;

The other thing that was tricky was, that my iterm2 prefs file is symlinked and therefore doesn't appear in the list of domains nor is read with the defaults tool. The keyboard however works, since it's listed in the prefs file already.