xkbcommon / libxkbcommon

keymap handling library for toolkits and window systems
https://xkbcommon.org
Other
286 stars 125 forks source link

Rules: Include does not lookup context paths #501

Closed wismill closed 2 months ago

wismill commented 3 months ago

Contrary to keymap files, the ! include statement in rules does not lookup include paths added to xkb_context. So it is not possible e.g. to import another file in the same folder without using an absolute path.

I know the first intended use is using system path, e.g. ! include %S/evdev (see #108), but I expected to be able to use the statement as the keymap one.

My current use case is to be able to modify the rules for the tests in #450 without duplicating the whole rule file. I want to be able to use ! include evdev and resulting in including the first file named rules/evdev found in the xkb_context include paths. Meanwhile I defined XKB_CONFIG_ROOT and used %S.

Apart from that, this is for consistency with the rest of the lib. So low priority.


PS: I did not realize that ! include is not supported by XOrg tools. Might be worth added a note in the compatibility page and in the rule file page.

whot commented 2 months ago

PS: I did not realize that ! include is not supported by XOrg tools. Might be worth added a note in the compatibility page and in the rule file page.

Too many different tools, all need to be updated (and know that the next level supports it). Yay the Unix way! Too much effort for the gain.

So it is not possible e.g. to import another file in the same folder without using an absolute path.

That definitely sounds like a bug to me, so adding that would get my ack.