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

Make it possible to add single-command top-level sublayers #4

Merged
merged 3 commits into from
Oct 22, 2022

Conversation

jhanstra
Copy link

@jhanstra jhanstra commented Oct 3, 2022

This repo is incredible - thanks so much for putting it together! I always avoided Karabiner mostly because of its complicated configuration. Your project makes it so much easier to work with and so much more powerful. I'm geeking out on how much faster I'm going to be now.

There was one big feature I found myself really wishing I had as I started playing around with it and getting used to the keyboard shortcuts. Sublayers are absolutely necessary to namespace the commands so that you can fit everything you need to - however for a few major shortcuts I use all the time, 10x+ more than others, I wanted to put those on their own first level. For example, for switching to VSCode I wanted to just use hyper + c. For Homerow search/movement, I wanted to just use hyper + m. This wasn't possible before but with this PR you can now do that, like this:

...createHyperSubLayers({
    c: app("Visual Studio Code"),
    a: app("Arc"),
    m: { to: [{ key_code: "h", modifiers: ["right_control"] }]}, // Homerow search
    u: { to: [{ key_code: "s", modifiers: ["right_control"] }]}, // Homerow scroll
    o: {
      a: app("Arc"),
      v: app("Visual Studio Code"),
      n: app("Notion"),
      ....
    },

Submitting it as a PR in case you / others find it useful!

@mxstbr
Copy link
Owner

mxstbr commented Oct 3, 2022

I'm glad you found this useful, and thank you for contributing! This looks like a useful improvement, I'll look at the code when I have a few spare minutes 🙌

@mxstbr
Copy link
Owner

mxstbr commented Oct 22, 2022

I found a slightly cleaner version of this change as I realized that setting the hyper key sublayer variable is unnecessary for these root-level commands! Thanks for the PR 🙌

@mxstbr mxstbr merged commit d029454 into mxstbr:main Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants