Make IBus-Mozc start in Hiragana rather than Direct input mode

Solution 1:

  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

Solution 2:

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

Solution 3:

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.