Home > System Tutorial > LINUX > Teach you how to set up a Japanese environment in Arch Linux

Teach you how to set up a Japanese environment in Arch Linux

WBOY
Release: 2024-05-08 09:20:15
forward
1049 people have browsed it

In this tutorial, we will discuss how to set up a Japanese environment in Arch Linux. In other Unix-like operating systems, setting up a Japanese layout is not a big deal. You can easily select Japanese keyboard layout from settings. However, it is a bit difficult under Arch Linux and there is no proper documentation in ArchWiki. If you are using Arch Linux and/or its derivatives such as Antergos, Manajaro Linux, please follow this guide to use Japanese in Arch Linux and its derivatives.
教你在 Arch Linux 中设置日语环境

Set up Japanese environment in Arch Linux

First, in order to view Japanese characters correctly, install the necessary Japanese fonts:

sudo pacman -S adobe-source-han-sans-jp-fonts otf-ipafont
pacaur -S ttf-monapo
Copy after login

If you haven't installed pacaur yet, please see this link.
Make sure you comment out (add # comments) the following lines in /etc/locale.gen.

#ja_JP.UTF-8
Copy after login

Then, install iBus and ibus-anthy. For those wondering why, iBus is an input method (IM) framework for Unix-like systems, and ibus-anthy is a Japanese input method for iBus.

sudo pacman -S ibus ibus-anthy
Copy after login

Add the following lines in ~/.xprofile (create one if it does not exist):

# Settings for Japanese input
export GTK_IM_MODULE='ibus'
export QT_IM_MODULE='ibus'
export XMODIFIERS=@im='ibus'
#Toolbar for anthy
ibus-daemon -drx
Copy after login

~/.xprofile allows us to execute commands at the beginning of the X user session but before the window manager is started.
Save and close the file. Restart your Arch Linux system for the changes to take effect.

After logging in to the system, right-click the iBus icon in the taskbar and select "Preferences". If not, run the following command from the terminal to start iBus and open the preferences window.

ibus-setup
Copy after login

Select “Yes” to start iBus. You will see a page like the one below. Click Ok to close it.
教你在 Arch Linux 中设置日语环境

Now, you will see the iBus Preferences window. Go to the “Input Method” tab and click the “Add” button.

教你在 Arch Linux 中设置日语环境

Select "Japanese" in the list:

教你在 Arch Linux 中设置日语环境

That’s it. You will now see "Japanese - Anthy" in the input method bar:

教你在 Arch Linux 中设置日语环境

Change the Japanese input method options in the preferences according to your needs (click "Japanese-Anthy" -> "Preferences").

教你在 Arch Linux 中设置日语环境

You can also edit the default shortcut keys in the keyboard bindings. Once you've made all changes, click Apply and OK. That's it. Select Japanese from the iBus icon in the taskbar, or press the SUPER Spacebar (LCTT Annotation: The SUPER key is usually the Command or Window key) to switch between Japanese and English (or other default languages ​​on the system). You can change keyboard shortcuts from the iBus Preferences window

.

Now you know how to use Japanese in Arch Linux and its derivatives. If you find our guide useful, please support us by sharing it on your social and professional networks.

The above is the detailed content of Teach you how to set up a Japanese environment in Arch Linux. For more information, please follow other related articles on the PHP Chinese website!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template