34

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?

Nicolas Raoul
  • 11,921

5 Answers5

8
  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, (this is another method, choose one).

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

Lainnya
  • 81
5

ArchWiki Workaround: https://wiki.archlinux.org/title/Mozc#Configuration

vi $HOME/.config/mozc/ibus_config.textproto

...
active_on_launch: True
...

Restart the system and the ibus-mozc starts in Hiragana mode. This works at least Debian/Ubuntu as well as Arch.


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

1

This was added in a recent version of ibus-mozc. No compiling needed!

You can edit config file ~/.config/mozc/ibus_config.textproto, under engines {} in the curly brackets add a line composition_mode: HIRAGANA. Save and apply with ibus write-cache; ibus restart.

Selenimoon
  • 151
  • 4
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.

0

A suggestion stated in the bug report of the issue to just switch to libkkc, where you can configure the initial mode, is likely the best solution.

karel
  • 122,292
  • 133
  • 301
  • 332
rusins
  • 161