Installation

To set up the Hiragana IME, follow the steps below:

  1. Install the Hiragana IME software package
  2. Add the Hiragana IME to the input sources
  3. Enable the Hiragana IME
  4. Install additional components for using LLM

Install the Hiragana IME software package

If you use Fedora or Ubuntu, the Hiragana IME package will be automatically downloaded during installation using the dnf or apt command.

Instructions for Fedora

The RPM packages are available in the Copr project at @esrille/releases. To enable this Copr project, enter the following command into a terminal:

sudo dnf copr enable @esrille/releases

To install Hiragana IME, use the following dnf command as usual:

sudo dnf update
sudo dnf install ibus-hiragana

Instructions for Ubuntu

The Debian packages are available in the PPA repository at esrille/releases. To enable this repository, enter the following command into a terminal:

sudo add-apt-repository ppa:esrille/releases

To install the Hiragana IME, use the following apt command as usual:

sudo apt update
sudo apt install ibus-hiragana

Install from source

To install the Hiragana IME from the source code, enter the following commands into a terminal:

git clone https://github.com/esrille/ibus-hiragana.git
cd ibus-hiragana
meson setup --prefix /usr _build [-Denable-dic=true] [-Denable-html=true]
ninja -C _build
ninja -C _build install

Refer to Build-Depends in debian/control or BuildRequires in ibus-hiragana.spec for the packages required for building the Hiragana IME.

If you are using Fedora, you can use the following command to install the required packages:

sudo yum-builddep ibus-hiragana.spec

If you are using Ubuntu, you can use the following command to install the required packages:

sudo apt build-dep .

Change the input method module for Wayland

From Ubuntu 21.04 and Fedora 25 onwards, Wayland is used by default for screen rendering. Wayland is being developed to replace the classic X server.

GNOME is also developing a new input method module for Wayland. However, it is still in the early stages of development. In GNOME 45 or earlier, the surrounding text information sent to input methods is broken. In GNOME 46, the surrounding text information is not sent to input methods at the right time with many applications.

So, we recommend using the IBus input method module even on Wayland. To do so, define GTK_IM_MODULE environment variable in your ~/.bash_profile (in Fedora) or ~/.profile (in Ubuntu) as below.

export GTK_IM_MODULE=ibus

You can check the version of GNOME by opening the GNOME Settings window, then going to About This System-System Details.

Add the Hiragana IME to the input sources

Note: Keyboard layouts and input methods are collectively referred to as input sources.

After installing the Hiragana IME software package, restart your computer. Then, follow the steps below to add the Hiragana IME to the input sources. The steps for setting up the input sources differ depending on your desktop environment.

Instructions for GNOME

On Fedora and Ubuntu, GNOME is the default desktop environment. The Hiragana IME currently works best in GNOME. If you're using GNOME, open Settings and add Japanese (Hiragana IME) to Input Sources in the Keyboard pane.

Settings—Keyboard

Instructions for other desktops

Open IBus Preferences, and select the Input Method tab. Add Hiragana IME to the list of Input Method by selecting the following item:

icon Hiragana IME

Enable the Hiragana IME

In IBus, you can switch between multiple input methods and use them.

To enable Hiragana IME, open the keyboard menu of the desktop shell by clicking the current input method logo like ja inside the top bar. Then select Japanese (Hiragana IME).

Keyboard menu

As for the keyboard layout, Hiragana IME uses the previously selected keyboard layout.

When you can't find the keyboard layout you want to use, add your preferred layout to the Input Sources. Currently, Hiragana IME supports three keyboard layouts: Japanese, English (US), and English (Dvorak).

Note: Often, different keyboard designs are used from country to country for each language. In Japan, both Japanese and US keyboards are used. The US keyboard is designed in the United States. Nevertheless, it is also utilized in many other countries by modifying the letters printed on the keycaps.

Install additional components for using LLM

Hiragana IME has a feature that pre-selects the most probable conversion candidate using a Large Language Model. To use this, the following packages need to be installed:

Hiragana IME runs within a local Python virtual environment (venv). To install the above packages with this venv, follow these steps:

  1. In Hiragana IME Setup window, enable the Use LLM for candidate selection option.

Hiragana IME Setup Window

  1. Click Install, and the following window will open.

Post Installation Window

  1. Click Install to start the installation. The installation log will be displayed within the window.
  2. Once the installation is finished, the Install button will change to a Close button.

Post Installation Window

  1. Click Close to close the window.

The installation of the required packages for using LLM is now complete. When you log in again, you can use the candidate pre-selection feature using LLM.

Updates

When a new release of the Hiragana IME is available, we will announce it on the Releases page on GitHub. The steps for updating the Hiragana IME depend on how you install it. Follow the update steps that correspond to your installation method.

Instructions for Fedora

The Hiragana IME can be updated just like other Fedora packages. To do so from the command line, use the following dnf command:

sudo dnf update

Instructions for Ubuntu

The Hiragana IME can be updated just like other Ubuntu packages. To do so from the command line, use the following apt commands:

sudo apt update
sudo apt upgrade

Updating from the source code

To update the Hiragana IME from the source code, enter the following commands into a terminal:

git pull
ninja -C _build
ninja -C _build install

Uninstall

The steps for uninstalling the Hiragana IME depend on how you install it. Follow the uninstall steps that correspond to your installation method.

Instructions for Fedora

To uninstall the Hiragana IME, use the following dnf command:

sudo dnf remove ibus-hiragana

Instructions for Ubuntu

To uninstall the Hiragana IME, use the following apt command:

sudo apt remove ibus-hiragana

Uninstalling from the source code

To uninstall the Hiragana IME that is built from the source code, enter the following command into a terminal:

sudo ninja -C _build uninstall

ninja does not remove the directory /usr/share/ibus-hiragana with the install command. To remove this directory, enter the following command into a terminal:

sudo rm -rf /usr/share/ibus-hiragana

User data stored in your home directory

The Hiragana IME stores user data in the directory ~/.local/share/ibus-hiragana/. Under this directory, the Hiragana IME stores your input histories, user dictionary file(s), and also its Python venv:

~/.local/share/ibus-hiragana/
├── dic/        # Your input histories
├── my.dic      # User dictionary file
└── venv/       # Python venv for the Hiragana IME

If you want to install the Hiragana IME on other PCs, you can use the copy of the directory dic/ and the file my.dic.

Clean uninstall

If you want to remove all user data after uninstalling the Hiragana IME, you can remove the directory ~/.local/share/ibus-hiragana/:

rm -rf ~/.local/share/ibus-hiragana

If you used the Hiragana IME with the LLM packages, the tohoku-nlp/bert-base-japanese-v3 files are stored in the directory ~/.cache/huggingface/hub/models--cl-tohoku--bert-base-japanese-v3/. Please note that these files might be used by other applications that use Transformers. If you are sure that you want to delete these files, enter the following command into a terminal:

rm -rf ~/.cache/huggingface/hub/models--cl-tohoku--bert-base-japanese-v3