33

Every time I restart my computer and want to type in Japanese, pressing Super+Space is not enough, I also have to select Hiragana in Mozc's menu:

Ubuntu Mozc IBus direct input hiragana

It gets me everytime. It is a bit like if your car's brake acted as an accelerator the first time you use it each day. Everyday the first time you brake you have to remember to push a lever. In other words: Incredibly annoying and a sure way to get accidents.

Apparently noone is motivated to fix the underlying problem, and there were talks that IBus would be replaced with Fcitx in 2015.10 (it did not).

Meanwhile, is there a quick way to fix this problem to avoid having to click that every time?

5
  • 4
    Same problem here after upgrade to 16.04. It works previously on 14.04.
    – bagustris
    May 23 '16 at 11:36
  • 2
    Not a solution, but I edited the keyboard shortcuts so that I now press super+space and then use alt+` to switch to hiragana input. This is under Tools->Properties and then "Customize" the keyboard map. Jul 21 '16 at 20:07
  • @computermacgyver that workaround could be a partial solution and it adds value to this topic. Could you post that as answer? Mention that it is just a workaround.
    – user.dz
    Feb 2 '17 at 10:38
  • Looks like same unresolved question here askubuntu.com/questions/561486
    – user.dz
    Feb 2 '17 at 10:40
  • @user.dz: They are very similar indeed, but that question asks for a shortcut, while I ask for a way to just make it start that way. Feb 9 '17 at 1:10
6
  1. You can modifying the source code and rebuild

     sudo apt install build-essential devscripts -y
     sudo apt build-dep ibus-mozc -y
     apt source ibus-mozc
    
  2. cd ~
    then edit ./mozc*/src/unix/ibus/property_handler.cc and replace

     #if IBUS_CHECK_VERSION(1, 5, 0)
     const bool kActivatedOnLaunch = false;
    

with

    #if IBUS_CHECK_VERSION(1, 5, 0)
    const bool kActivatedOnLaunch = true;

or wrap the preprocessor directive condition with a logical NOT, to #if !(...) (this is another method, choose one).

Now edit ./mozc*/src/protocol/commands.proto, and replace

    enum CompositionMode {
    DIRECT = 0;
    HIRAGANA = 1;

with

    enum CompositionMode {
    DIRECT = 1;
    HIRAGANA = 0;
  1. build it

     cd mozc*
     dpkg-buildpackage -us -uc -b
    
  2. sudo apt install ./ibus-mozc*.deb (dfsg version)

  3. reboot

3
  • Thanks. Worked for me on elementary OS 5.1.2 (based on 18.04 bionic) after installing some of the dependency debs that were also built in step 3. Also I needed to uncomment the first deb-src line (line 5) in /etc/apt/sources/list for step 1.
    – Carolus
    Mar 29 '20 at 15:21
  • If you want your custom version of ibus-mozc not to be over-written by system-updates, you can increase the version number in the first line of ./mozc*/debian/changelog. I'm not knowledgeable of what I'm doing, so take my advice with some grains of salt.
    – Carolus
    Apr 5 '20 at 15:42
  • I made an Ansible script of this for my own purposes and with slight adjustments I shared it here. I'm definitely not an expert in any of this, but the script seems to work for me.
    – Carolus
    Apr 25 '20 at 8:50
4

This is not an answer for the question but a work around for the problem.

If you have no problem to switch input method into fcitx

sudo apt install fcitx-mozc

Then it works almost the same as ibus-mozc and it remembers the choice of Hiragana/Katakana/Direct and etc.

[edit] inline conversion looks like inline_conv

11
  • Installing this made no difference to me, I'm not sure how to actually switch the method to fcitx.
    – Sam Bull
    Aug 29 '20 at 16:21
  • System settings > Language Support select fcitx, then System settings > Text Entry choose Mozc (Fcitx), restart your computer. In my view @Lainnya 's answer is more practical. Aug 29 '20 at 16:35
  • Hmm, in Language Support, it is already set to fcitx. I can't find the "Text Entry" option though. Under "Language and Region" I can set the input source, but I only see a "Japanese (Mozc)" option, no Fcitx. If I uninstall ibus-mozc, then the Mozc option disappears. If it makes any difference, I'm running Ubuntu 20.04 with vanilla GNOME.
    – Sam Bull
    Sep 1 '20 at 22:06
  • 1
    Instruction page ibus&fcitx here For me, fcitx-mozc is way better than ibus-mozc I am a native Japanese speaker for nearly 50 years. If I were typing Japanese once per week, then I do not mind ibus-mozc or it is not set on Hiragana at start, since iBus v1.5 from Ubuntu 16.04 has had many minor bugs which often interferes my typing and it is really annoying/distracting. This is why I regret to use fcitx (since 10.04 ibus has been bright). You don't have to uninstall ibus, if you want sudo apt purge ibus Sep 1 '20 at 22:47
  • @SamBull Worked for me, I'm also on 20.04. Follow the "Instruction page ibus&fcitx" link above. Google translated page is well readable.
    – rapstacke
    Sep 2 '20 at 13:38
1

Briefly skimming over this link, I think the general gist is that this isn't going to get "fixed?"

Anyway, I have a workaround. (At least on kde and xfce4.)

  • Run ibus-pref.
  • Go to Input Method, and hit the Preferences for Mozc.
  • Click on Customize... for Keymap style.
  • Hit Edit in the lower left corner and make a New Entry
  • This new entry should be for "Direct Input" and the action should be Activate IME.
  • As for the Key, be sure to pick something not frequently used by a lot of other applications.
  • You can also add another entry for Deactivate IME.

Restart after this. Or maybe just logout is enough? I do know that I only noticed this working after I did a restart, though.

3
  • Could you please detail how it works after you reboot? You just press the chosen key, and immediately you can start typing in Hiragana? Feb 24 '17 at 2:54
  • You may still have to use the super+space to switch. The system tray should tell you which input method you're on. You can also try qtconfig-qt4, go to Interface > Default Input Method, switch to ibus (found it here). After you're on the Mozc Input, you should just be able to press your selected key. (e.g. I chose insert for both table entries) Feb 24 '17 at 3:30
  • So the procedure is the following, right? : 1) Log in. 2) Press super+space. 3) Press the chosen key. 4) Type in hiragana. It does not fix the problem but it saves a few seconds at each login. It does not save the time lost during the "start typing おはよう - realize that ohayou came out - remember about this bug" sequence though. Feb 24 '17 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.