Home | News | Download | Packages | Forum | Wiki | Github

Installing Japanese Input Method

(Scott Robbins) #22

I gave the various solutions here a try, but have had almost no luck. The closest I got was with openbox, and tint2 showing an icon. I could click the icon and choose ibus-mozc but nothing happened. It also gave me an option to choose input method, I tried hiragana, but again, nothing happened.
Steps I took
Installed ibus-mozc. Set the variables in bashrc (and they worked, when I tried echo $XMODIFIERS and so on, it gave me the desired result. Ran ibus-setup (changing input to the old ctl+space). Ran ibus-daemon & (and also tried with ibus-daemon --xim & which has served me on other distributions in the past.)
Also tried the fcitx solutions but fcitx-configtool gave me no option to add a mozc input. I guess I can just hope that sooner or later, someone packages fcitx-mozc (or fcitx-anthy or kkc). Or I suppose I could just use translate.google.com and type things in there, then copy and paste it. :slight_smile:

Is there an official way to request a package? (Though with a relatively small group, I suspect that unless someone with package knowledge is learning Japanese, there might not be a reply.) I don’t have the skill myself. I was hoping to find an fcitx-mozc tarball that could be built from source, but so far, I only see separate packages for fcitx and mozc, both of which are provided by void repos.

It’s about the only thing keeping void from being a perfect choice for me.

(Scott Robbins) #23

Darn, the edit button isn’t working for me, so I’ll have to add this. It does work for me in gtk apps, such as firefox or libreoffice. It doesn’t however, work in a urxvt terminal, so I would still consider it defective. (In all other distributions I use, as well as FreeBSD, I use fcitx-mozc, or fcitx-kkc in RedHat based ones, which don’t use mozc, as anthy has been dead upstream for a few years. In all cases, I can enter Japanese in a urxvt terminal.

So, while this makes it better, it still means I can’t use Japanese in say, mutt unless I write in libreoffice, save as text and then read it into a mutt email which is a somewhat cumbersome workaround. Oh well, further ahead than I was a little while ago. :slight_smile:

Sigh and next time I go into X it doesn’t work for me again. Last time, I was able to switch successfully in gtk apps with ctl+space, but the next time I startx, it no longer works. So, for me at least, it’s proving somewhat unreliable in openbox.

And then I try again. Using the icon on tint2, I choose Japanese mozc and for input choose hiragana and this time, after hitting ctl+space, I am able to toggle between Japanese and English. However it’s not at all reliable for me. I’m not sure if I’ve missed something (I also ran the gtk-query commands) but, (especially from what I’ve seen in this thread) it does seem that ibus on Void is somewhat iffy. (It’s become fairly iffy on various other distributions as well as FreeBSD, another reason I use fcitx-mozc or fcitx-kkc when available.) Hopefully, someone will make an fcitx-mozc package one of these days.

Ok, last edit of the night. It turns out that to get it to work, I have to first, using the tint2 taskbar, choose hiragana as input method. I then have to open a gtk app, such as firefox. Once I do that, if I hit shift space, it enables me to switch between Japanese and English. It won’t write in a terminal though. (I assume it would in Gnome-terminal, but I don’t plan to install that.) So at least I can get it to consistently input Japanese in libreoffice or firefox.

(Scott Robbins) #24

And it seems that someone did succeed in building an fcitx-anthy package for void.

Pity they didn’t share it. (It’s mentioned fairly far down in the thread, just search for fcitx-anthy on the page.

And a further update. Putting void on a second laptop, this time I have different bugginess. It will work in urxvt and gtk, (after running the update-cache stuff but I can’t change input with the keyboard shortcuts, I have to use the icon on tint2 to change between direct input and hiragana. Frustrating this is one of the few things keeping void from being perfect for me. :frowning:

And then, upon reboot, it no longer works in urxvt though still works in GTK applications. I can also make a little script, and if I call it (say through dmenu) it will switch between Japanese and English in GTK apps. But again, I lost the urxvt input that I had this morning. (The script can be found in the FreeBSD section of my page http://srobb.net/jpninpt.html)

if [ ibus engine = ‘mozc-jp’ ]; then
ibus engine xkb:us::eng
ibus engine mozc-jp

(Backticks around the first ibus engine and single quotes around the first mozc-jp)

(Scott Robbins) #25

I managed to get fcitx-anthy working, albeit an old version. Thanks to user cr6 who pointed out that my recent request for fcitx-mozc was a repeat of an old request of mine .[package request] fcitx-mozc

Anyway, here are the instructions.
Install, with xbps-install -S fcitx-devel and anthy-devel (as well as fcitx and anthy).
Make sure you have cmake and pkg-config installed as well. Go to https://download.fcitx-im.org/fcitx-anthy and download
https://download.fcitx-im.org/fcitx-anthy/fcitx-anthy-0.2.2.tar.xz, the 0.2.2, not the more recent 0.2.3, because that won’t build with Void’s current version of fcitx.

Untar it and follow its INSTALL. Change into the untarred directory, mkdir build;cd build. Then run cmake …
(If that’s not clear in anyone’s browser, that’s cmake and two dots). This should build fcitx-anthy successfully. When complete, still in the build directory, run make, then sudo make install. Anthy may then be automatically set as the input method. If not, I have a page about Japanese input, http://srobb.net/jpninpt.html which describes the manual process. Start fcitx -d, then kill X. You will now have a $HOME/.config/fcitx directory. In it, there will be a file called profile. Edit the profile file, look for anthy:False and change the False to True. Start X again, start fcitx and it should work. (You also need to set XMODIFIERS, GTK_IM_MODULE and QT_IM_MODULE. In addition, I like to set LC_CTYPE to en_US.UTF-8. I set these in my .xinitrc before the line calling the window manager.

export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export LC_CTYPE=en_US.UTF-8

To get it to work with gtk apps, one first has to do
xbps-install -S libfcitx-gtk3 libfcitx-gtk

Then, AFTER that’s done

sudo gtk-query-immodules-2.0 --update-cache
And the same for 3.0 as mentioned earlier in this thread.

Hopefully, this will help someone.

I have a slightly more detailed summary on my Japanese in *nix page at http://srobb.net/jpninpt.html#VoidLinux

(Scott Robbins) #26

And it seems as if this no longer works. Now, trying to install fcitx-devel, necessary for this, breaks libfdisk and util-linux. Perhaps at some point the request for fcitx-mozc, or even at this point, an official package for fcitx-anthy will come through, but at present, it’s back to the somewhat broken, at least in some window managers, ibus.

One solution does seem to work though–install void, then before running xbps-install -Syu run install xbps-install fcitx-devel. Not sure if this will break anything else though.

(Scott Robbins) #27

And further follow up, the problem seems to have been a one time thing. Installing again I was able to do the usual xbps-install -Su and then install fcitx-devel. So, all seems good.

(Scott Robbins) #29

As this is probably where google will bring one looking for Japanese in Void, I should add that on the x86_64 version, fcitx has been brought up to date, so one can use the fcitx-anthy-0.2.3 tarball, the latest.

(Scott Robbins) #30

And there is now a package for fcitx-mozc. :slight_smile:

Many thanks to all for their work.


i have been waiting for this! kudos to everyone involved


It’s great to see so much support among the user community here at void!

A lot of people really helped on this topic.

I think though, in this case, things have been presented as more complicated than they really are. it’s generally very simple to get ibus and ibus-anthy working.

You need to install both ibus and ibus-anthy packages!

Then add these lines to .xinitrc (or other equivalent for your WM/Desktop):

export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
ibus-daemon -drx

Then logout and log back in. You should have a little icon in your system tray.

That’s really all there is to it.

I run the fluxbox WM, so I put these lines in .fluxbox/startup instead of .xinitrc. But those 4 lines are all it takes to start ibus with anthy input method on Xorg startup. You will also need Japanese fonts of course. To switch input methods, press: CTRL-SPACE. You should see a little graphic popup indicating which language you are choosing.

Good Luck! がんばってください


for anyone using fcitx, my .xinitrc looks something like:

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
fcitx &

right now, we don’t have a package for fcitx-anthy so you would have to compile from here, remember to install fcitx development packages namely fcitx-devel and such


It’s on the way. :wink:

Feel free to open tickets about stuff like this!

(Scott Robbins) #35

Great, thank you!