Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature request/question: zmk-helpers support #101

Closed
hendstephen opened this issue Jun 20, 2024 · 4 comments
Closed

Feature request/question: zmk-helpers support #101

hendstephen opened this issue Jun 20, 2024 · 4 comments

Comments

@hendstephen
Copy link

Does this/will this support urob's zmk-helpers module, found below? I used version 1, but switched to a normal declarative config to use this keymap-drawer. There are some conveniences I miss though, and have thought about using v2. Is this something that keymap-drawer could support?

https://github.com/urob/zmk-helpers/tree/v2?tab=readme-ov-file

@caksoylar
Copy link
Owner

Not right now, at least if you use the recommended installation method through config/west.yml.
This is something I have been thinking more about, since ZMK is moving more into using west modules. While most modules aren't relevant to keymap drawing, the zmk-helpers one specifically is.

Currently there are two separate things that need to be done to be able to use modules:

  1. Fetch the listed modules: This can be done via utilizing west (e.g. as part of the automated workflow) or re-implementing some of its logic by parsing west.yml
    • This step can be skipped in CLI use, since we could require local paths for modules
  2. Add the module contents to the "include" path: This is needed to be able to #include files that live in modules, like noted here
    • Initial implementation could involve adding a module path arg to keymap parse, where we'd parse module.yml in it and find the right paths to use

I should probably look into this soon, but these are not the fun parts of the project as you can imagine 😄

@caksoylar
Copy link
Owner

Oh, I think this workaround could be used right now if you really want to use both zmk-helpers/v2 and keymap-drawer: Place this folder in config/zmk-helpers. Then usage like #include "zmk-helpers/helper.h" should work with keymap-drawer, since the files will actually be in those relative paths.

@hendstephen
Copy link
Author

Thanks! I figured I could just pull them in locally as a workaround if needed. Totally understand there is more higher priority work, maybe I'll poke around on a fork if I have some free time.

@caksoylar
Copy link
Owner

Thanks to @stijnveenman, this is now possible through #105 and #107.

You need to add the include path to your config:

parse_config:
  [...]
  zmk_additional_includes: ["zmk-helpers/include"]

If you are using the Github workflow, you need to also set the west config path so it fetches west modules (including zmk-helpers) first in your workflow yaml:

jobs:
  draw:
    uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main
    permissions:
      contents: write  # allow workflow to commit to the repo
    with:
      [...]
      install_branch: main  # need this until the next release to get the latest keymap-drawer
      west_config_path: 'config'

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants