[ Language select: 日本語 ]

1. Client environment

In the seminar room, Xubuntu is installed on ThinkPad as a terminal for working.

  • OS: Xubuntu (Distribution with lightweight desktop environment using Xfce instead of Ubuntu’s Gnome3) Distribution) (LTS) with lightweight desktop environment using

  • Packages: ibus, language-pack-en, docker, kubectl, etc.

For Network environment such as IP address, please refer to link:. /servers[about network configuration] page.

The ThinkPad and other computing environments located in Seminar Room 10 are built by Abe on his own.
If you notice any glitches or anything after you log in, please let me know right away.
(e.g. I logged in, but there is no home directory, no application, I don't know how to use it, etc.)

2. How to log in

On the Xubuntu login screen, select "Other…​" and enter your AINS ID and password in the same way as in the exercise room.

client.xubudesk login user switch

3. How to start the application

General applications such as web browsers and terminals (Terminal Emulator) should be launched from the menu in the upper left corner of the screen.

client.xubudesk top left menu

3.1. Terminal application

The terminal application is listed by default in the menu window.

client.ubuntu menu terminal

If you would like to use other terminal application, please type the keyword, such as terminal, at the top search window.

4. How to check available commands

Some operations can be executed by root (privileged) user. Specify the content you wish to execute following the sudo command as an argument.

## How to check which commands can be executed by sudo
$ sudo -l

The sudo command can be used to check the contents of files that can only be read by the root user.

$ ls -l /etc/sudoers
-r--r----- 1 root root 779 May 2 2018 /etc/sudoers
$ sudo cat /etc/sudoers

5. Main customization method

The configuration means other than brightness adjustment can be accessed from the Settings menu of the menu.

Alternatively, you can enter the word "mouse" in the text window at the top of the menu to refine the settings.

client.xfce4 menu

5.1. Adjustment of screen brightness

If the screen is dark, etc., hold down the Fn key on the keyboard and press the F5, F6 keys to adjust the screen brightness.

client.20230214 screen brightness

The Fn key is located in the lower left corner of the keyboard.

5.2. Mouse operation (touchpad, track pointer)

By default, both touchpad and track pointer are enabled.

In the "Mouse and Touchpad" settings screen, you can enable or disable them, change the cursor speed, etc.

The figure below shows the TouchPad disabled.

client.mouse touchpad

The TrackPoint is easy to use once you get used to it, but you should adjust the "Acceleration" setting so that the cursor speed is appropriate for your finger strength.

client.mouse trackpoint

5.3. Resolution setting

A screen resolution of Full HD (1920x1080 pixel) can be set for x270, t430(s). If you have a problem with a narrow screen or, conversely, a screen that is too wide and the text is too small, please set the resolution individually. Please set the screen resolution individually.

client.xfce4 display

5.4. Japanese input method

First, we will explain the change operation up to inputting Japanese.

5.4.1. Selecting Input Method

Open the "Language Support " menu and set IBus to Input Method.

client.language ibus

5.4.2. Selecting a Japanese conversion engine

Open the "IBus Preferences " menu, open the Input Method tab, and press the "Add" button.

Select "Japanese" and choose the Mozc (Google Japanese Input compatible) as your input method.

client.ibus pref engine selecter

5.4.3. Remove unwanted conversion engines

After adding Mozc, remove the English input (English - English(US)) or other items, such as "Japanese".

client.ibus pref delete english

5.4.4. Switching Japanese input method after setting

Immediately after changing the settings, Japanese input is not yet enabled.

No need to reboot, but the fastest way is to log-out and to log-in again.

5.4.4.1. Behind the Japanese Switching

To enable Japanese input without logging out, you need to change environment variables appropriately and then restart the process.

The main environment variables are as follows

export CLUTTER_IM_MODULE=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export XMODIFIERS=@im=ibus

Since these are automatically set based on the settings in the Language Support menu, they are set in the parent process by re-logging in, and are passed on to the child processes, so that Japanese input method is possible in each application without awareness.

5.4.5. Using Mozc with the English keyboard

The "Mozc" is one of the major Japanese input methods due to the ibus-anthy has not been available since ubuntu 24.04.

Because a Japanese keyboard seems to be essential to use the Mozc, a user needs to use the dropdown menu on the top menu bar to switch the English and Japanese input mode.

We can assign any key to switch the English and Japanese input mode as follows.

5.4.5.1. Changing the keymap with the "Mozc Settings"

To customize the Mozc, we use the "Mozc Settings" application.

First, choose the "Mozc Setup" application from the top menu.

client.mozc menu

Next, push the "Customize…​" button to edit the keymap.

client.mozc preference

5.4.5.2. Assigning the F12 key for the Zenkaku-Hankaku function

The following procedure explains to enable the F12 key as the IME activate and deactivate functions.

To assign a new function, select the "New entry" item from the "Edit" pull-down menu.

client.mozc newentry

Then, a new empty item will be added at the bottom of the keymap table.

Assign new entries as follows.

Mode Key Command

DirectInput

F12

Activate IME

PreComposition

F12

Deactivate IME

For the actutal use, add one more function to the F12 key.

This is just an example, you can choose any key and command for your use.

Mode Key Command

Composition

F12

Set input mode to Hiragana

client.mozc keymap

If you feel the settings are not activated, then log-out and log-in operation at first.

5.4.5.3. Mozc default keymaps

The following default key binding might be useful for the actual use.

  • F6 - Hiragana (default)

  • F7 - Katakana, full-width

  • F8 - half-width

  • F9 - Alphabet, full-width

Please use and confirm these key bindings.

6. Japanese input in UNIX environment

In the UNIX environment, the mechanisms related to the language input are layered as follows, with multiple applications in each layer.

Basically, Japanese input is realized by selecting and combining the applications you want to use from each layer.

+---------------------+
|  Conversion Engine  | <-- Anthy, Mozc, SKK, Canna, etc. (Japanese-specific functions such as consecutive clause conversion, predictive conversion, etc.)
+---------------------+
|    Input Method     | <--- ibus, fcitx, iiimf, etc. (control of input independent of languages other than Japanese, Shift+Space to start input, etc.)
+---------------------+
| Desktop Environment | <-- Xfce, GTK/Gnome, QT, etc. (focus management of Text widget in Web browser, interface to XIM/immodule, etc.)
+---------------------+
|         X11         | (provides the lowest level of functionality, e.g. displaying text on the screen)
+---------------------+

Note that on Windows and macOS, all layers other than the Conversion Engine can only be used as provided only by the OS, so the system is practically not so much customizable.

6.1. Language input mechanism in X11 environment

You may not be aware of the Japanese input mechanism, but here is an overview of the Japanese input in the X11 environment.

6.1.1. Mechanism for receiving input from the keyboard (functionality provided by the X server)

Since X11 needs to support various languages other than Japanese, it provides a mechanism to convert characters input from the keyboard into other characters (data) by some program.

The basic mechanism is called XIM (X Input Method), which provides only a mechanism for the X11 server to pass input from the keyboard to another program.

The other program to which the X11 server passes data, i.e., another program to process input from the keyboard, is called Input Method Library/Server, and a variety of programs are provided. (e.g. uim, ibus, scim, fcitx)

Then, there are generally conversion programs that take care of the actual processing from these IM servers, i.e., convert keyboard input into each language, including Japanese. (e.g. fcitx-anthy, fcitx-mozc, ibus-skkk, scim-canna)

6.1.2. Mechanisms for converting to characters of each language

There are mechanisms (conversion engines) to convert keyboard input received by an IM server into Japanese and other languages. Common conversion engines for Japanese available on Linux include anthy, mozc, skk, and canna.

Since the supported conversion engines vary depending on the using IM server, there are limitations on the combinations that can be used.

  • anthy - A common Japanese conversion engine that performs serial clause conversion (supported by IM servers such as fcitx, ibus, scim, etc.)

  • mozc - Predicts from input characters like Google Japanese Conversion (supported by IM servers like fcitx, ibus, uim, etc.)

  • skk - Japanese conversion engine originated from Emacs. It is very powerful when you type a lot of text, such as when writing a paper (supported by IM servers such as fcitx, ibus, uim, scim, etc.).

  • canna - Japanese conversion engine that has been around for a long time along with Wnn (supported by IM servers such as uim, scim, etc.)

The combination of IM servers and these Japanese language engines provides the Japanese input environment in X11.

This division of labor provides the ability to support other languages and new languages that do not yet exist.

6.2. Mechanism for Japanese input by X11 applications (clients side)

First, X11 is the foundation on which desktop environments such as Gnome and QT are built, and older X11 applications that do not use these environments are run. Each level handles Japanese input slightly differently, but they all use XIM or their own mechanism using environment variables.

You can check the relevant environment variables in the following ways

$ env |egrep 'ibus|IM' |sort
CLUTTER_IM_MODULE=xim
GTK_IM_MODULE=ibus
## omit
QT4_IM_MODULE=ibus
QT_IM_MODULE=ibus
## Omit
XMODIFIERS=@im=ibus

GTK and QT are built on top of the X11 library, but they also provide their own way of doing things without using XIM for fine control. If you use the GTK/QT proprietary settings, X11 applications that do not use those widgets will not be able to input Japanese.

Conversely, if an application handles its own Japanese input, the GTK/QT Japanese input may get in the way. In such cases, launching emacs as follows will disable Japanese input via XIM.

$ env XMODIFIERS=@im=none GTK_IM_MODULE=xim emacs

Emacs invoked this way will not allow Japanese conversion via ibus.

Use this setting if you want to communicate with a Japanese conversion engine written in Emacs-Lisp or an other Japanese conversion engine from Emacs-Lisp.

6.3. When using your own Japanese conversion engine in Emacs

Even when activated as described above, Emacs has its own Japanese conversion function, so Japanese conversion itself is possible.

  1. To prepare for inputting characters, press C-x b to create an appropriate Buffer or open an empty file

  2. Press C- ↓ and type "japanese" when asked "Input Method:". 3.

  3. Perform the conversion by roman input.

Another well-known Japanese conversion engine is ddskk. In addition, you can use other Japanese conversion engines different from ibus on Emacs by using anthy.el or mozc.el from Emacs.

In this case, it is also possible to communicate directly with the Conversion Engine if Emacs provides the Input Method functionality.

6.3.1. When using Anthy with Emacs

Start emacs and then invoke anthy-mode as follows.

M-x load-library
anthy

Once the anthy library is loaded, Japanese input can be toggled on and off in the following way

M-x anthy-mode

6.3.2. Using Mozc with Emacs

The basic procedure is the same as for anthy, but the library names are slightly different.

M-x load-libarary
emacs-mozc/mozc.el

Thereafter, you can switch between them with M-x mozc-mode as in Anthy.

6.3.3. Using SKK with Emacs

Since the library is already installed, you can use it in the same way as anthy and mozc.

6.4. About Other Customization

6.4.1. Remap CapsLock and Control keys

Occasionally, a user would like to change the CapsLock key with the Control (Ctrl) key.

Although there are several methods, I will introduce two of the major ones.

6.4.1.1. The xmodmap command

It is most general way under the X11 environment, so that you can use any OS and linux distributions, such as CentOS in exerceise rooms.

There are following descriptions when executing the man xmodmap command.

       !
       ! Swap Caps_Lock and Control_L
       !
       remove Lock = Caps_Lock
       remove Control = Control_L
       keysym Control_L = Caps_Lock
       keysym Caps_Lock = Control_L
       add Lock = Caps_Lock
       add Control = Control_L

Now, you can save them into the ~/.Xmodmap file. You don’t need to remove white spaces on the beginning of lines.

Then, you can execute the xmodmap command with the ~/.Xmodmap file as follows:

$ xmodmap ~/.Xmodmap

As a result, the CapsLock key is replaced by the Ctrl key. If you execute the above again, then keys are returned to the original state.

The ~/.Xmodmap file will be loaded automatically when you log in to the system, so that you don’t need to execute the command at the next time.

If you would like to know more details, please read the /etc/xdg/xfce4/xinitrc file.

6.4.2. Xubuntu keyboard Application

You can use the GUI keyboard application instead of the xmodmap command.

This method strongly depends on the desktop environment, so you cannot use this way at the exercise room terminals because these are CentOS.

Execute the keyboard application on the top left menu.

Select Caps Lock at the Change layout option, then select Right Ctrl at Compose key.

client.keybaord swapcapsctrl

7. Troubleshooting

7.1. My keyboard is unable to input any symbols

If your keyboard

If you are unable to type the [ symbol and it becomes @, it is possible that the keyboard types are in Japanese.

As a workaround, you can execute the following command.

$ setxkbmap us

Next, confirm the Keyboard setting application status.

If you see the Japanese keyboard layout in the Layout tab, add the English(US) keyboard layout at first, then remove the Japanese keyboard layout from the list.

client.keyboard layout