Using Linux/Ubuntu but can't type in Japanese in ANKI

My OS is Linux/Ubuntu. I can’t type in Japanese in Anki. I can type in Japanese in other applications such as LibreWrite.

Hello, it’s been a while since you made this so maybe you solved it already.

Do all other applications work?

Bear with me, because I do not use Ubuntu. (Something something btw.)

The ubuntu community help wiki does not tell me exactly what input method is used, but given it mentions mozc and the gnome-control-center package requires the libibus package, I’m going to assume the input method is ibus with mozc! You might want to double check that by running in a terminal the following command: ps aux | grep ibus and pasting the output here if you’re new to linux/are unsure how to read it.

I assume there’s no need to actually look at the settings in ibus-setup, as everything should be fine there…

My first thought is that something’s off with the environment variables; I’ve no idea how Ubuntu handles these natively. Every new install I get these wrong, and noone seems to have an idea, either - the given variables that were on the Arch wiki for ibus didn’t work for me, and I spent several evenings frantically searching ever more obscure forums before I eventually found the magic voodoo variables that have worked (and no popular site seems to give these ones, I had to add them to the wiki myself!)

For me, those variables are the following:

export GTK_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
export XIM_PROGRAM="/usr/bin/ibus-daemon -drx"

which you’ll probably need to change if you’re on wayland (but I have no idea how) and you may want to try them without that last line first as well as the following:

GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus

To set them, it’s probably best to put them in your /etc/profile; edit it with sudo privileges. You’ll need to relog/reboot for them to take effect.

Good luck and let me know if I can help at all with further troubleshooting.

1 Like

Aha, apparently those variables shouldn’t need changing on Wayland.

Hello Hearth,

I very much appreciate the helpful information you sent me regarding Anki/Linux/Ubuntu.

I have used Anki for studying Japanese for several years. I recently switched my operating system from Windows to Linux/Ubuntu. I am in the process of learning, at the same time, the Linux/Ubuntu system and solving my problem of not being able to type Japanese in Anki. Unfortunately I am not very skilled yet using the Terminal in Ubuntu. Therefore I am a bit shy about using your recommendations at this time. I need to improve my understanding of the use of the Terminal before trying to understand and use your recommendations. I am going to save your suggestions and refer to them from time to time as my understanding of the Linux/Ubuntu/terminal system improves and I feel more comfortable following your suggestions.

Thank you very much for your help,

th

That’s fine. If you would like to learn more about some of the suggestions, I would look up ‘Input Methods’ on the Ubuntu linux and the Arch linux wikis, as well as ‘Envrionmental Variables.’ There’s possibly an ‘Ibus’ page on the Ubuntu wiki; there’s a pretty good one on the Arch wiki.

As for the commands I mentioned to check if ibus is running, you can read about what the commands and the flags passed to them do by opening a terminal and typing man + the command name. The two commands are ps and grep, the flags passed to the first one are aux, which changes the output. The | between the two passes the output of the first command to the latter, this is called piping. You can also look all this up on google if you are uncertain about typing man in the terminal; just type man + command name into google instead, and you will find the man pages hosted online instead. (But the ones on your system will be the best to look at, as they will be the same version.)

All the best! I can’t link pages directly because of the forum rules.

1 Like