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

Add support for :all in rules #334

Closed
wants to merge 2 commits into from

Conversation

wismill
Copy link
Member

@wismill wismill commented May 7, 2023

This PR adds support for the :all modifier in rules & include statements.

For example, the xkeyboard-config issue “rules: add custom per-group mapping for level3(ralt_alt)” could be solved easier with this feature:

! layout        option	        = symbols
*               lv3:ralt_alt    = +level3(ralt_alt):all

xkbcomp would require a patch too, though (see the corresponding xkbcomp issue).

This feature works by detecting the number of layouts in the RMLVO configuration. Example: it will replace the include statement xx:all by xx:1+xx:2+xx:3 if there are 3 layouts and the merge mode is “override”.

Caveat: it only works when a keymap is created from RMLVO configuration; i.e. it will not work when creating a keymap e.g. from a string. But I guess this case is not so important, because as I understand querying the keymap to the windows system will return a complete & resolved keymap without include statements.

Note: this could the first step to remove the limit of layout number (see #37 and #311, @bam80).

@bam80
Copy link

bam80 commented May 7, 2023

Thanks for notifying me Wismill!
Looking forward to get this merged.

@bam80
Copy link

bam80 commented May 7, 2023

For example, the xkeyboard-config issue “rules: add custom per-group mapping for level3(ralt_alt)” could be solved easier with this feature:

! layout        option	        = symbols
*               lv3:ralt_alt    = +level3(ralt_alt):all

Could we actually make it easier as part of this PR?

@wismill
Copy link
Member Author

wismill commented May 7, 2023

You mean patching the rule file in xkeyboard-config ? Different project; it will require X11 xkbcomp to be patched before.

@bam80
Copy link

bam80 commented May 7, 2023

OK, do you consider to make a patch for X11 xkbcomp also?

@wismill
Copy link
Member Author

wismill commented May 7, 2023

OK, do you consider to make a patch for X11 xkbcomp also?

@bam80 Let’s focus on this PR. Having a first draft enables us to discuss its design with the experts @whot and @bluetech. I also have to fix the tests first!

@wismill wismill force-pushed the wip/rules-all-layout-syntax branch 2 times, most recently from f062f1b to bbbb09a Compare May 8, 2023 11:18
@wismill wismill marked this pull request as ready for review May 8, 2023 11:23
@wismill wismill force-pushed the wip/rules-all-layout-syntax branch from bbbb09a to fef19d0 Compare May 13, 2023 16:22
@bluetech
Copy link
Member

@wismill I'd like to review this PR (it'd be really great to fix this!), it might take me a bit of time to get to it though, wanted to give you a heads up.

@wismill
Copy link
Member Author

wismill commented May 13, 2023

No rush, currently the tests are failing. I am content waiting for your review: I would like to get the design right, as it would be wonderful to port it to X11’s xkbcomp then start moving things in xkeyboard-config. Though it would probably take years to transition the rules, if distros need to first pickup compatible xkbcomp.

@wismill wismill added enhancement Indicates new feature requests compile-keymap Indicates a need for improvements or additions to keymap compilation labels May 14, 2023
@wismill wismill mentioned this pull request Jun 30, 2023
@wismill
Copy link
Member Author

wismill commented Jul 6, 2023

Closing. I am working on another approach, where the processing happens only in the rules. This should facilitate a possible adaptation to libxkbfile.

@wismill wismill closed this Jul 6, 2023
@wismill wismill mentioned this pull request Jul 13, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants