fcitx5-anthy and libreoffice

I have fcitx5-anthy installed in order to input Japanese. On my main workstation, it's fine. However, both on a laptop and a VM, I am unable to input Japanese in libreoffice. (The only other applications I use with Japanese are firefox and urvt, both of which work.)

For what it's worth, on my main workstation, I found that I did have to install fcitx5-qt5 for libreoffice to work, however, on the laptop, I have the same qt packages installed, but when I hit ctl+space, nothing happens. (In urxvt, for example, an input window appears when I use ctl+space.) I'm wondering if anyone else has run into this, or perhaps with fcitx5 and another language, such as Chinese or Korean, and has any suggestions. Using fcitx-mozc or fcitx-anthy works in libreoffice without a problem, as long as I've installed fcitx-qt5. I don't see anything in logs, and don't know where else to look.
 
Thanks, but yes, I've already checked that and it's not the problem. (I use either openbox or dwm, and checked keyboard shortcuts in both.)
 
I installed fcitx5, fcitx5-qt5, ja-fcitx5-anthy and tried editors/featherpad as a qt5 app.
No specific settings.
fcitx5&
env QT_IM_MODULE=fcitx featherpad
Japanese can be input with Ctrl+Space.
Is it a libreoffice problem, not qt?
I think urxvt is xim, so it has nothing to do with the qt app.
 
I have found that I have to use export GTK_IM_MODULE=xim for Firefox to work. But I tried, on the VirtualBox install, (one of the ones where libreoffice isn't working), installing featherpad and trying it, no luck there either. Thank you for installing and trying, I do appreciate it, it's very nice of you. Fortunately, it is working on my main workstation, the important one, but it's aggravating that it doesn't work on the laptop or VirtualMachine. (I tried installing and using featherpad on that machine too, and it does work on that machine, the workstation. I'm not sure what urxvt is, but that does work, as does firefox which I'm pretty sure is GTK. (It works with fcitx5 as long as I use the environment variable GTK_INPUT_MODULE=xim).

Just in case I'm missing something obvious, this is my $HOME/.xinitrc
export XMODIFIERS=@im=fcitx export GTK_IM_MODULE=xim export QT_IM_MODULE=fcitx export LC_CTYPE=en_US.UTF-8 exec openbox-session
which is the same as the working workstation. So, especially as featherpad didn't work either, it seems to be a QT issue.
On the workstation that works, I see I also have some qt6 stuff installed (apparently pulled in as dependencies by other packages).

Also, if I really had need, I could create it in vi in urxvt, then open it in libreoffice, then save it as docx. That works. (If I open the txt document in featherpad, that works too.)
 
Finally had some luck with web-searching and found https://github.com/fcitx/fcitx5/issues/178. For whatever reason. I'm still not quite sure why it works with my workstation as is, and needs this on the VM and the laptop, but the trick is to have, in my .xinitrc, instead of exec dwm or exec openbox-session, use exec dbus-launch dwm or exec dbus-launch dwm.

Thanks to all who gave suggestions.
 
I have found that I have to use export GTK_IM_MODULE=xim for Firefox to work. But I tried, on the VirtualBox install, (one of the ones where libreoffice isn't working), installing featherpad and trying it, no luck there either. Thank you for installing and trying, I do appreciate it, it's very nice of you. Fortunately, it is working on my main workstation, the important one, but it's aggravating that it doesn't work on the laptop or VirtualMachine. (I tried installing and using featherpad on that machine too, and it does work on that machine, the workstation. I'm not sure what urxvt is, but that does work, as does firefox which I'm pretty sure is GTK. (It works with fcitx5 as long as I use the environment variable GTK_INPUT_MODULE=xim).

Just in case I'm missing something obvious, this is my $HOME/.xinitrc
export XMODIFIERS=@im=fcitx export GTK_IM_MODULE=xim export QT_IM_MODULE=fcitx export LC_CTYPE=en_US.UTF-8 exec openbox-session
which is the same as the working workstation. So, especially as featherpad didn't work either, it seems to be a QT issue.
On the workstation that works, I see I also have some qt6 stuff installed (apparently pulled in as dependencies by other packages).

Also, if I really had need, I could create it in vi in urxvt, then open it in libreoffice, then save it as docx. That works. (If I open the txt document in featherpad, that works too.)
Did you read messages displayed when installing textproc/fcitx5, which is done by textproc/fcitx5/files/pkg-messages.in?
And you should need textproc/fcitx5-gtk with FLAVOR at least gtk3 (default, pkg name would be fcitx5-gtk3) for Gtk3 apps like www/firefox.
 
Yup, I read it and it didn't work for me as written. for example, fcitx5 message says set
export GTK_IM_MODULE_IM=fcitx/xim

If I do that, I don't get Japanese in firefox. If I set it to
export GTK_IM_MODULE_IM=xim it works.
GTK hasn't been a problem for me, as long as I do that. The problem was with QT apps, and as I said above, it seems that for whatever reason, dbus isn't making a session for them unless I use exec dbus-launch <window-manager>, e.g., fluxbox, dwm, or openbox. If I use a desktop environment such as xfce4, I don't have this problem, so I assume that xcfe4 is doing whatever it should be doing with dbus that openbox, etc., aren.t

I've covered it on my own page about it. For whatever reason, I need dbus-launch for qt apps to work and GTK_IM_MODULE=xim for gtk ones to work. I have't messed with flavors at all, everything's been installed with packages.
Edit: Added way after the fact, but in case it comes up in someone's websearch, if using Wayland labwc, or dwl, the only ones I've used, they also have to be started with dbus-launch labwc (or dwl) for QT apps to work with Japanese.
And for those who come here, I do have a page on it at https://srobb.net/jpninpt.html (under FreeBSD and Wayland sections, there's a table of contents at the top of the page.)
 
Last edited:
In my experience, a few different installs on a Thinkpad, my main workstation, and a VirtualBox install, I have found that using GTK_IM_MODULE=xim will enable me to input Japanese in GTK programs, (just tried Firefox and xfce4-terminal).

I just gave cwm a try, but like the other WMs as opposed to DE's I tried, I had no luck with qt apps unless I put exect dbus-launch cwm.
On the other hand, have GTK_IM_MODULE=xim in my .xinitrc did enable me to use Japanese in firefox. (I don't know if you've tried that one yet, but so far it's worked for me every time, and with every WM/DE that I've tried.)
,
 
My original post had me mistyping fcitx5-mozc where I meant fcitx5-anthy. I've fixed it, but no, there isn't, as of March 9, 2024, a ja-fcitx5-mozc, only anthy. So, I've fixed this post, but T-Aoki was correct, my original said fcitx5-mozc.

Well, had to do a reinstall on my main workstation, and once again, can't get fcitx5-anthy working with QT applications. I made a quick VM, and as long as I did dbus-launch openbox-session, it was fine. I don't see any packages on the working install that are missing from the non-working one. So, for now, back to fcitx-mozc for now. Frustrating though, I can't find the issue.

EDIT: Well, deinstalled, reinstalled and now all is fine. And this time, it worked without adding the dbus-launch part to .xinitrc. Maybe that was the problem, but at this point, I'm happy with it.
 
fcitx5-mozc
Really?! I want it to be ported and hits official ports tree.
Maybe actually fcitx-mozc or fcitx5-anthy?

I once looked into japanese/fcitx-mozc (for chinese/fcitx, aka fcitx4) and its master port japanese/mozc-server and found fcix5-mozc support is intentionally killed (maybe) for sane fcitx4 support.
My current attempt is not successfull, because of fatal lack of knowledge for their build system internals.
 
Pft, thanks. Not yet wide awake. I've fixed my post, but yes, I did mistype my original post, I did type fcitx5-mozc. Sorry for any confusion.
 
Back
Top