Crostini is the new Google project to bring Linux apps to ChromeOS. Input method is on the roadmap but it has not been implemented yet in the current preview version of Crostini. The situation is a little bit different from the regular Linux one because it is running Wayland and using Google’s sommelier project to passthrough into the ChromeOS host Wayland.
To set it up, in your Crostini container do:
sudo apt install fcitx # and your IME engine, example for Taiwanese users: fcitx-chewing sudo apt remove fcitx-module-kimpanel
Then you should use
fcitx-config-gtk3 to set it up.
Now we need to set up a few environment variables and we want those to apply to
starting application from launcher menu too. I found that we can set it up here
in this file
/etc/systemd/user/cros-garcon.service.d/cros-garcon-override.conf. This file
might be overwritten in the future with updates. Suggestions are welcome for a
better location. You should put in these extra lines in there:
Environment="GTK_IM_MODULE=fcitx" Environment="QT_IM_MODULE=fcitx" Environment="XMODIFIERS=@im=fcitx"
Finally, we need to start fcitx daemon. I just put this one-line in
~/.sommelierrc to do the work:
That’s all! Now enjoy typing Chinese in the Linux apps on Chrome OS!