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

15.10ibusjapanesemozc

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?

Best Answer

  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 (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;
    
  3. build it

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

  5. reboot
Related Question