Chewie Lin

There are still no official support for direct input method framework for applications in wayland but existing program like ibus and fcitx can kinda work with xwayland bridge enabled. If xwayland is not an option, there is uim-fep that still works in console.

uim in sway

Strictly this works best in console applications and it doesn't need xorg/xwayland bridge. You can get uim-fep from the ubuntu repository, arch AUR, etc. There is also uim-fep github. And you also need an input engine like anthy.

Once it is installed, you should config the $HOME/.uim file like this:

;;; japanese input options ;;;
(define default-im-name 'anthy)
(define generic-on-key? (make-key-predicate '("F4")))
(define generic-off-key? (make-key-predicate '("F4")))

'I use anthy engine and F4 key to switch between hiragana and direct input for example. you can use any other uim compatible engine for korean or chinese. After that, just launch it in your console:

uim-fep

And you should get a status line at the bottom like this:

maxwidth

This works in urxvt and termite, Xorg and wayland. If you happen to also use GNU screen or emacs, there is a nice screen integration with uim-fep. Example $HOME/.screenrc:

backtick 0 0 0 uim-fep-tick
hardstatus alwayslastline "%0`"
bind j exec | uim-fep -S 
bind k eval 'exec cat' kill redisplay

In some wayland apps, simply press F4 key also activates uim in the background. This seems to work for some gtk gui applications as well but it is unstable.

ibus in sway (xwayland)

Ibus panel did not work for me in sway by default, you need to set the correct env variable to KDE to show the appindicator:

XDG_CURRENT_DESKTOP=KDE ibus-daemon -drx 	

Not a good solution but at least it shows the status icon in the systray.
Overall, it works but in some application the drop-down menu is buggy and the key switch doesn't work. Alternatively, you can control it through command line or bind them to your own keys:

ibus engine kkc
ibus engine xkb:us::eng

The main concern is that ibus still requires python2. For a python2 free ibus, you can check out my AUR build file ibus-sway.

fcitx in sway (xwayland)

Fortunately, fcitx key switches and system tray icon works out of the box. Otherwise, you can also control it via command line:

fcitx-remote -s mozc
fcitx-remote -s fcitx-keyboard-us

Also you might need to add "ibus" or "fcitx" to:

/etc/environment

INPUT_METHOD=fcitx
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

Reference: