Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate setting a keyboard shortcut #171

Open
2 tasks done
schneems opened this issue Sep 13, 2021 · 2 comments
Open
2 tasks done

Automate setting a keyboard shortcut #171

schneems opened this issue Sep 13, 2021 · 2 comments
Labels
discussion Discuss about macOS automation

Comments

@schneems
Copy link

  • I made sure this feature is not in the commands list
  • I searched and didn't find this feature request in the listed issues

I'm looking for a command to set a keyboard shortcut on the terminal. I would like to set this as a default on all new machines https://mobile.twitter.com/techgirl1908/status/1067500256516952065. I tried running:

defaults find Keyboard | pbcopy

I recorded it after setting the keyboard shortcut manually, and then again after deleting the value and then fed both into diffchecker. The diffs were identical. Which lead me to believe that this value is not persisted in defaults.

If defaults doesn't capture this setting do you know what might? Also might it be helpful to list what preferences are not able to be set via this command?

Thanks a ton for the repo, it's been hugely helpful.

@schneems schneems added the discussion Discuss about macOS automation label Sep 13, 2021
@yannbertrand
Copy link
Owner

Hi @schneems thanks for your message and your patience.

I think I've found out where it's located (I've used defaults read to get all keys), take a look at:

$ defaults read NSGlobalDomain NSUserKeyEquivalents

Got to make sure we can set it using command line tho.

Can you try it out and create a PR if it works? 😄

@schneems
Copy link
Author

Thanks for the reply! I am able to see those two:

$ defaults read NSUserKeyEquivalents
2021-10-14 13:35:02.300 defaults[61302:17355892]
Domain NSUserKeyEquivalents does not exist
$ defaults read NSGlobalDomain | grep mouse
    "com.apple.mouse.scaling" = "1.5";

Regarding my original use case, it turns out that doing this: https://mobile.twitter.com/techgirl1908/status/1067500256516952065 interferes in other applications in ways that are difficult to predict. For instance, in slack, I usually hit CMD+SHIFT+Enter to open a "create snippet" dialog. With that CMD+V hack, for some reason, that feature in slack became unusable. 🤷‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discuss about macOS automation
Projects
None yet
Development

No branches or pull requests

2 participants