Well for fcitx5, you’d sudo pacman fcitx5 fcitx5-mozc fcitx5-qt fcitx5-gtk and then instead of:
It would be:
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
I forgot that GNOME has ibus integrated. I don’t personally use GNOME so I don’t know if ibus works better or not on GNOME