You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RMLVO: support for applying option on specific layout index #500
The idea would be to be able to have a suffix per option, such as it applies only to some layout indexes.
Some preliminary ideas:
, cannot be used as a suffix delimeter, as it is the option separator.
: should not be used as a suffix delimeter, e.g. eurosign:e:2, because it is ambiguous.
@ seems an interesting candidate; it clashes with nothing currently. E.g.: eurosign:e@2
We should embrace Modern rules #362 and introduce @all, @first, etc. as well.
We need DE devs to be implied, if we want a proper UI to be developed.
There should be none or only very limited breakage, as it is the “compiled” keymap that is shared by the compositor with the apps, not the RMLVO values.
I like this idea (without varargs)! But the new suffix syntax would still be useful for CLI, wouldn't it?
We need to figure out how to handle this in xkeyboard-config. The standard way is to duplicate for each layout index. #362 may come handy. Or we may implement an expection in rules resolving for the new API.
heh, sort-of but I usually get angry when I see scripts using short args, forcing me to decypher what -xDRtdg means in that context... that's why I'm quite a fan of adding long args only, these days Ctrl+R should get you 80% of the way there anyway :)
And even if we want more than 4 groups/layouts, well, we're not going to run out of numbers, so --layout-256 for the truly bonkers can be added on demand ;)
And even if we want more than 4 groups/layouts, well, we're not going to run out of numbers, so --layout-256 for the truly bonkers can be added on demand ;)
Then we would need to change the args-parsing function or use a macro, because this will not scale.
Maybe add only a --index arg that overload the next arg, e.g.:
what I don't like about --index arguments is that instead of each argument meaning exactly one thing, it's now a state machine that you need to remember and/or script correctly.
I'd have to look it up but there's a way you can expand a macro into more things so we can have a #define opt("--layout", 256) which then expands into the right getopt lines. Though unless we really want to support a ridiculous number of layouts it's easier to just type this out once and be done with it forever.
I think that supporting this feature properly would require to add support in rules files for option component with a layout index, e.g. option[2] = symbols.
However, since layout matches a single layout and layout[1] matches the first layout in a 2+ layouts config, we would not be able to maintain backward compatibility or consistency. So I would skip the digits indexes and implement #362 indexes directly:
single, e.g. option[single]
first
later
any
a new value, auto, that implements the current behavior, e.g. option would be the same as option[auto].
But wait, it does not make sense for some options to be applied on specific layout indexes (e.g. types, compat, option that modify modifiers mappings). So we would also need to communicate this via the XML registry file.
Activity
whot commentedon Aug 26, 2024
Or make this a proper builder API so we don't have to worry about magic syntax. Something like:
or, for those who really like varargs:
sd-bus uses the latter extensively but in your case I think the first approach is better.
No backwards compat issue either since it's a new API :)
wismill commentedon Aug 26, 2024
I like this idea (without varargs)! But the new suffix syntax would still be useful for CLI, wouldn't it?
We need to figure out how to handle this in
xkeyboard-config. The standard way is to duplicate for each layout index. #362 may come handy. Or we may implement an expection in rules resolving for the new API.whot commentedon Aug 26, 2024
Might be better to dream up a new syntax. after all the xkbcommon cli isn't quite as wide-spread through config files everywhere as e.g. setxkbmap's.
A rather lame but easyn enough approach would be:
Since we only have 4 groups that's not impossible to implement.
wismill commentedon Aug 26, 2024
We really need to add short CLI arguments 😅.
And we need to keep #37 in mind.
whot commentedon Aug 26, 2024
heh, sort-of but I usually get angry when I see scripts using short args, forcing me to decypher what
-xDRtdgmeans in that context... that's why I'm quite a fan of adding long args only, these days Ctrl+R should get you 80% of the way there anyway :)And even if we want more than 4 groups/layouts, well, we're not going to run out of numbers, so
--layout-256for the truly bonkers can be added on demand ;)wismill commentedon Aug 26, 2024
Then we would need to change the args-parsing function or use a macro, because this will not scale.
Maybe add only a
--indexarg that overload the next arg, e.g.:whot commentedon Aug 26, 2024
what I don't like about
--indexarguments is that instead of each argument meaning exactly one thing, it's now a state machine that you need to remember and/or script correctly.I'd have to look it up but there's a way you can expand a macro into more things so we can have a
#define opt("--layout", 256)which then expands into the right getopt lines. Though unless we really want to support a ridiculous number of layouts it's easier to just type this out once and be done with it forever.wismill commentedon Aug 28, 2024
I think that supporting this feature properly would require to add support in rules files for
optioncomponent with a layout index, e.g.option[2] = symbols.However, since
layoutmatches a single layout andlayout[1]matches the first layout in a 2+ layouts config, we would not be able to maintain backward compatibility or consistency. So I would skip the digits indexes and implement #362 indexes directly:single, e.g.option[single]firstlateranyauto, that implements the current behavior, e.g.optionwould be the same asoption[auto].But wait, it does not make sense for some options to be applied on specific layout indexes (e.g. types, compat, option that modify modifiers mappings). So we would also need to communicate this via the XML registry file.
libxkbcommon: update to 1.12.0.
libxkbcommon: update to 1.12.0.
libxkbcommon: update to 1.12.0.
libxkbcommon: update to 1.12.0.
libxkbcommon: update to 1.12.0.
libxkbcommon: update to 1.12.0.