I'm using Gnome with an international keyboard and I configured it to use fcitx IBus. I also installed Google_Japanese_Input in Windows, where it behaves as expected:
- Alt + Shift switch between languages (IMEs)
- Ctrl + Caps Lock switch to Hiragana
- Alt + Caps Lock if in alphanumeric mode change to Hiragana, then switch to Katakana
- Shift + Caps Lock switch between full-width Hiragana ↔ full-width alphanumeric (romaji)
- Alt + ` (Grave Accent) switch between kana ↔ half-width alphanumeric (romaji)
- Alt + ~ (Tilde) toggle kana/direct input
These keyboard shortcuts do not work in Gnome. I have to select the modes manually from the menu.
I understand that Alt + ` interferes with the application switcher shortcut but I doubt that I'm the only user using Gnome and trying to get it to work like an average user would do on any other platform. If there was a serious issue with the existing keyboard mappings there should at least be some kind of best practice or recommendation how to create a useful mapping instead of everyone starting from scratch rolling her/his own? I'm not convinced by existing answers (1, 2) and I could not find any good resources how a Linux user is supposed to configure and use Mozc (1, 2) efficiently.
So my question I'd like to have a complete answer here is:
- What is the recommended Japanese input method for Ubuntu 18.04 and later? (I assume it is Mozc.)
- Which packages need to be installed?
- How is the input method configured in Gnome? (A Windows user just downloads and installs the Google software for comparison. It just works.)
- How to set up the input method itself?
- How to set up switching of input modes?
- Are there any conflicts with keyboard shortcuts? How to resolve?
- Are there any conflicts with other IMEs or software components (like UIM, IBus)? How to resolve?
- Is there any useful documentation how to use the IME? (Or typical Japanese IME in general.)
- Would be useful to verify that it is working correctly.
- Understanding how the software is supposed to be used by average users. There seem to be a lot of shortcuts and additional functionality to tweak but also to make your experience worse than instead of going with the default where possible.
Update:
After a few reboots I find that fcitx does not work when I set the mode to Hiragana and type in Gedit. Trying to reconstruct the behavior I must have been using Ibus at the time. When I try Ibus it works.
I had reset my keyboard shortcuts on this computer when I moved from Unity to Gnome, thus running the defaults except for the take screenshot key which I have disabled. I previously had setup custom compose keys (1, 2), but I disabled export GTK_IM_MODULE="uim"
and export QT_IM_MODULE="uim"
in my .profile
when moving to Gnome with Wayland due to a bug. Sequences like Compose+.+. and Compose+→+→ do work though.
When running fcitx I get the following output:
$ printenv | grep -i im_module
CLUTTER_IM_MODULE=xim
QT4_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
GTK_IM_MODULE=fcitx
When running ibus I get the following output:
$ printenv | grep -i im_module
CLUTTER_IM_MODULE=xim
QT4_IM_MODULE=xim
QT_IM_MODULE=ibus
GTK_IM_MODULE=ibus
Update 2:
Okay as far as I understand fcitx does not integrate well with Gnome at the moment. I try to go with IBus since I don't want fcitx to interfere with keyboards and configure keyboards in Gnome and fcitx (across several desktops and laptops). While I have no problems using Ctrl + Caps Lock and Alt + Caps Lock in Windows, Mozc on Linux has the Japanese keys in it's mapping and the Alt and Eisu keys don't seem to be supported. There is an entry on the Arch Wiki regarding X tools (I'm not sure about Wayland) and some Japanese users seem to have found their ways, but this is way too much for me right now.
Update 3:
While users on Arch use a custom AUR package I found a simple quilt patch for easy applying and recompiling to the latest version. I hope this can be included in Ubuntu one way or another while the Linux version has no documented way of making the quoted shortcuts work like on other OSes. With this annoyance gone I consider my issue almost solved. Lets see what happens with the bug report or upstream in the mean time.
The IMF is
IBUS
(comes installed from Ubuntu's ISO). The IME isMOZC
(most commented here in Askubuntu) followed byAnthy
.But it is so subjective. Install all of them! And try each one!
On Ubuntu 18.04, you need to install 3 kinds of packages:
Language
You need to install the japanese language (to get the base packages). Following the instructions in Writing Japanese with Ubuntu 18.04 LTS Bionic Beaver and Japanese Input:
system settings
, selectRegion & Language
.Manage Installed Languages
.Language Support
window, click onInstall / Remove Languages...
.Installed Languages
window, checkJapanese
, clickApply
.Log out
of your Ubuntu profile to get effect.IMFs packages
You can install one (or both) IMFs. Ubuntu comes with
ibus
installed. To install, type:sudo apt install ibus
sudo apt install fcitx
.IMEs packages
You need to install japanese IME(s) for each installed IMF. For example, Ubuntu comes with
ibus
IMF. So you can install one (or more) of these japanese IMEs:sudo apt install ibus-mozc
sudo apt install ibus-anthy
.sudo apt install ibus-kkc
.sudo apt install ibus-skk
.And if you installed
fctix
IMF, you will need to install at least one of its specific japanese IMEs:sudo apt install fcitx-mozc
sudo apt install fcitx-anthy
.sudo apt install fcitx-kkc
.sudo apt install fcitx-skk
.First install: japanese language, one IMF, and one japanese IME.
After that, you only need to click on
GNOME Status Menu
(Gnome's top-right bar) >IBus
menu (i.e. keyboard/input language selector) > Select your desired input method.Or use the shortcut: hold Super and press Space.
Each IMF and each IME have their configurations, menus, windows and so on.
To switch between japanese input modes (e.g. hiragana, katakana etc) is a important requirement. Each IME comes with their own:
GNOME Status Menu
to switch between japanese modes and access its configurations.No. Each IME has their keymap editor. So you can edit any conflict, if exists.
I don't thing so.
Only install all packages, select the IME from
GNOME Status Menu
and type in any text field.After select the installed japanese IME, you will need to know the shortcuts to change the japanese input mode. For example, you can see all
ibus-mozc
keymap and its romaji-hiragana table.Keyboard shortcuts to enable the IME and switch modes don't work at the moment as noted in various places.
Using a non-japanese keyboard on Linux to do this may be difficult to setup, it's easier to use fcitx or a patched build that starts with the IME activated when using IBus (which I prefer). See update 3 in the question for details. Typing Hiragana and switching with F6-F10 when necessary seems to get most of the things done when necessary as written here.
No, I couldn't find any so far. Configuring new shortcuts or getting the special japanese keys to work may get you into more trouble though. Configuring and using shortcuts for Gnome, a Music player, byobu and Tilix sometimes already get in the way of each other. It's better not to create more worries with custom shortcuts.
You can check with
im-config
(I had an.xinputrc
with only commented options which got in the way, I renamed it).ibus-setup
helps configuring IBus, but defaults are good as they are. I haven't found a way to make XCompose with UIM work at the same time for now, but basics like Compose+.+. work, for Emojis there is the new Charmap app.