Aloha!

Glad to see you are still alive on the net!

We discussed and tried to find the best approach for IMF to work flawlessly on both X11 and Wayland.

I have tested that the combination of a systemd user environment generator, a environment.d config and a systemd user service works for fcitx5, so I split a new package named systemd-inputmethod-generator for the generator and the config to see if it can benefit other IMFs like ibus and fcitx4. it’s a wrapper to translate the openSUSE xim.d preference mechanism to systemd environment.

Then ftake suggested update-alternative is also a brilliant idea. But I am a little unsure because it will need a lot of work on every existing IMF package to add the alternative. And as the alternatives are the generators, this approach will not benefit Xorg sessions, which will fallback to the old xim.d approach.

Maybe we can use the update alternative on Xorg too? or a joint effort between upstream and downstream? I have been thinking a “inputmethodd”(two “d”s) for long which will do the GTK/QT_IM_MODULE exports for all IMFs and work as a wrapper to start all kinds of IMFs. But certainly it’s beyond my programming capability.

What do you think, my best net friend? Either thoughts on openSUSE’s IMF auto start or any other good ideas are welcome with all my heart 

Marguerite

Weng Xuetian <wengxt@gmail.com>于2022年2月25日 周五21:12写道:
On Fri, Feb 25, 2022 at 4:50 AM Marguerite Su <i@marguerite.su> wrote:
> But still, like the name says, an user environment generator can not work as the 100% replacement for the xim script. We still need to write lots of systemd stuff (targets and etc) to achieve the goals that were done via the LibreOffice/gsettings hacks,  if you want to end up to an IMF systemd service
Just to point out, making the IMF a systemd service can be very tricky
for wayland. To use the wayland based input method protocol, certain
wayland compositors (weston, kwin) may pass a socket file descriptor
for the wayland connection for authentication and only such clients
can be used to talk to wayland.

Unless they are handled in some special away (I implemented a special
tool for fcitx5 to pass over the file descriptor
https://www.csslayer.info/wordpress/fcitx-dev/fcitx-5-and-multiple-wayland-compositor/
), the compositor is expected to launch the input method framework
server by themselves.