这是翻阅了许多在线教程得出来的一个较为中和的方案。

首先关注设置Fcitx5,这是Fcitx5的一篇官方教程。

这里提到:

其他不太常见的设置

还有一些其他变量可能对某些应用程序有用。 SDL_IM_MODULE

将值设置为 fcitx。只有 SDL2 需要这个。SDL1 使用 XIM。 GLFW_IM_MODULE

这是仅由[1]使用的变量。您需要将其设置为“GLFW_IM_MODULE=ibus”。 Binary Qt application

由于 Qt 5 不支持 XIM,并且它仅捆绑 ibus im 模块,因此您可能需要为不使用系统 Qt 库的 Qt 应用程序设置“QT_IM_MODULE=ibus”。 (它可能仍然无法工作,因为某些 Qt 应用程序甚至没有捆绑任何 IM 模块)。

于是我们尝试在/etc/environment设置如下环境变量:

XIM=fcitx5
XIM_PROGRAM=fcitx5
GTK_IM_MODULE=fcitx5
XMODIFIERS=@im=fcitx5
SDL_IM_MODULE=fcitx5
GLFW_IM_MODULE=ibus
QT_IM_MODULE=ibus

重启之后测试发现QQ、微信都有效了。

但是Fcitx5提示不建议设置````并建议查看网址https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma获取更多信息:

KDE Plasma

Best setup:

KDE Plasma 5.27 or later Environment variables: Set XMODIFIERS=@im=fcitx for XWayland application Start fcitx5 by go to "System settings" -> "Virtual keyboard" -> Select Fcitx 5 Do not set GTK_IM_MODULE & QT_IM_MODULE & SDL_IM_MODULE . You could unset GTK_IM_MODULE & QT_IM_MODULE by runing im-config and then selecting do not set any IM from im-config and use desktop default" Run chromium/electron application with --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime Caveats: Certain Gtk/Qt application that only works under X11 may still need to set GTK_IM_MODULE or QT_IM_MODULE for them individually. If you set GTK_IM_MODULE/QT_IM_MODULE globally, you will hit this issue Candidate window is blinking under wayland with Fcitx 5

Support Information:

App/Compositor supports text-input-v2 and text-input-v3. Comopositor/Application uses zwp_input_method_v1. 5.27 additionally supports text-input-v1. 5.24 usable zwp_input_method_v1 with fcitx5. Pre-5.24 there are lots of problems, always use fcitx im module instead. Use "Virtual keyboard" KCM to launch fcitx5. This is required to use text-input protocol. If you launch fcitx this way, make sure you do not use "restart" in the tray menu, since the socket passed from KWin can not be reused with the newly restarted fcitx.

但是实践中并未发现提到的问题。

标签: 输入法, fcitx5, KDE, Wayland

添加新评论