On Fri, 25 Feb 2022 05:32:31 +0100, Marguerite Su wrote:
[1
] Hi,
the update-alternative approach needs to adjust every ibus/fcitx/fcitx5 package and write their own generator scripts…it may be too hard for an input method framework maintainer to know everything about systemd…
I guess this could be simplified if we provide some rpm macro. Basically a similar setup has been done for /etc/X11/xim.d (even manually), and we may combine even both stuff in a single macro, too.
Currently my generator supplements systemd and a dummy “inputmethod” package, so any package provides “inputmethod” can use this generator.
The $LANG and .i18n can be added later, it’s easy actually. After these works, I think maybe we can remove Provides: lang(zh:ja:ko) tags from packages too.
Hm, then the question is whether we want to user leaving without language-specific IM when user installs in CJK locale (or anything else). Of course, they can install the stuff later at any time, but the point of having lang(x)-Provides or whatever meta data is just to "recommend" the installation of those packages for specific locales. A similar stuff could be implemented in patterns as well, but I feel that locale(x) makes maintenance easier. In anyway, this is a bit irrelevant with the IM choose mechanism itself, IMO. thanks, Takashi
actually this time I made the request just to split the generator from fcitx5 to benefit others, with no other further design/considerations, and I know the generator is just a skeleton now :-)
Marguerite
Fuminobu TAKEYAMA
于2022年2月24日周四23:22写道: Hi Marguerite and all,
Thank you for working to support IM on Wayland sessions.
I see your systemd-inputmethod-generator. https://build.opensuse.org/package/show/M17N/systemd-inputmethod-generator
It simply read a list of input methods and precedence from (/usr)/etc/X11/xim.d/en. I think it is ok nowadays since we do not need complex mechanisms provided by /etc/X11/xim anymore.
But I'm wondering how about using `update-alternatives` instead of reading /etc/X11/xim.d/en. A benefit of using update-alternatives is users can choose an input method by `update-alternatives --config` or YaST. `update-alternatives` is also used to configure a default display manager.
To use update-alternatives, firstly, we prepare: [1] /usr/lib/input-method/user-environment-generators/fcitx [2] /usr/lib/input-method/user-environment-generators/ibus
And run `update-alternatives --install` during installation: update-alternatives --install \ /usr/lib/systemd/user-environment-generators/29-input-method-generator \ input-method-user-environment-generator \ /usr/lib/input-method/user-environment-generators/fcitx \ 25
The following symlink to one of above will be generated: /usr/lib/systemd/user-environment-generators/29-input-method-generator
Note that if [1] and [2] does not contain any program, the file managed by `update-alternatives` can be /lib/environment.d/99-input-method.conf
What do you think?
If you plan to extend your input-method-generator so that it can read /etc/X11/xim.d/$LANG and/or ~/.i18n, etc., the current approach will be appropriate.
a related report: https://bugzilla.opensuse.org/show_bug.cgi?id=1084804
Best regards, Fuminobu Takeyama