Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackgris/b5a14479a2dbf96c835e6ec66a548e59 to your computer and use it in GitHub Desktop.
Save jackgris/b5a14479a2dbf96c835e6ec66a548e59 to your computer and use it in GitHub Desktop.
Config Chinese and Japanese input method in Manjaro

1. Install packages

run:

yay -S adobe-source-han-sans-otc-fonts adobe-source-han-serif-otc-fonts  adobe-source-han-sans-jp-fonts otf-ipafont
yay -S ttf-monapo

Make sure you have commented out (add # to comment out) the following line in /etc/locale.gen file.

#ja_JP.UTF-8
#zh_CN.UTF-8 UTF-8
yay -S ibus ibus-anthy ibus-rime 

2. Config environmental variables

Add the following lines in ~/.xprofile (If it doesn't exist, create one):

# Settings for Japanese input
export GTK_IM_MODULE='ibus'
export QT_IM_MODULE='ibus'
export XMODIFIERS=@im='ibus'

#Toolbar for anthy
ibus-daemon -drx

Log out and log in.

After logging in to your system, right click on the iBus icon in the task bar and choose Preferences. If it is not there, run the following command from Terminal to start IBus and open the preferences window.

$ ibus-setup

Now, you will see the iBus preferences window. Go to Input Method tab and click "Add" button.

Choose "Japanese" from the list. And then, choose "Anthy" and click Add. That's it. You will now see "Japanese - Anthy" in your Input Method section.

You can also edit the default shortcuts in the key bindings section. Once you made all changes, click Apply and OK. That's it. Choose the Japanese language from iBus icon in the task bar or press SUPER KEY+SPACE BAR to switch between Japanese and English languages (or any other default language in your system). You can change the keyboard shortcuts from IBus Preferences window. Do the same with Rime (for chinese)

3. To customize Rime

You should first create the rime config directory:

$ mkdir ~/.config/ibus/rime

In this directory, create a file named default.custom.yaml, where you can specify your input schema of choice. For example, if you want to be able to type pinyin with tones, you can use the Terra Pinyin input method by adding it to the list of enabled schemas:

default.custom.yaml

patch:
  schema_list:
    - schema: terra_pinyin

Note that the indentation level is important. This file overrides the default configuration. So if you only add Terra Pinyin, it will be the only schema enabled.

To make the customizations effective, you need to redeploy. You may find a ⟲ (Deploy) button and click it. Alternatively, use the following command, assuming you are using ibus-rime:

$ rm ~/.config/ibus/rime/default.yaml && ibus-daemon -drx

4. Switch input method

  • ctrl + Space
  • for japanese, "ctrl + ," change between hiragana and katakana
  • Tones are optionals but you can type them to filter the list very well. Here is how to type them:
1st tone: -
2nd tone: /
3rd tone: <
4th tone: \

Reference:

https://wiki.archlinux.org/index.php/IBus

https://wiki.archlinux.org/index.php/Rime#Chinese_punctuation

https://wiki.archlinux.org/index.php/Localization/Japanese

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment