How to type non latin 「CJK」 characters on Linux

Tags: en linux japanese tutorial video

【 multiple distro covered 】


『ON XUBUNTU』

➖ enter root environment ➖
  • sudo -i
➖ install package manager ➖
  • apt update
  • apt install synaptic
➖ search and mark for installation ➖
  • fcitx-mozc (japanese)
  • fcitx-sunpinyin (chinese)
  • fcitx-hangul (korean)

optionally, search for fonts i.e.: japanese, chinese, korean, cjk fonts

➖ initialize fcitx ➖
  • open fcitx
➖ configure fcitx ➖
  • open fcitx configuration
  • add input method using the “+” icon
  • uncheck “show only current language”
  • select mozc, sunpinyin or hangul
  • configure a shortcut to trigger the IM on the “Global Config” tab

enjoy it (๑˘︶˘๑)

COMMAND LINE ONE SHOT (for japanese)

  • sudo apt update && sudo apt install fcitx-mozc -y

to set fcitx as default input method we need to set the Pluggable Authentication Modules.

create the file .pam_environment on your home and append these lines:

XMODIFIERS DEFAULT=@im=fcitx
GTK_IM_MODULE DEFAULT=fcitx
QT_IM_MODULE DEFAULT=fcitx

don’t forget the white line at the end or in newer versions of pam won’t let you login

reference: https://bugs.archlinux.org/task/67636

single commmand:

  • echo -e "GTK_IM_MODULE=fcitx\nQT_IM_MODULE=fcitx\nXMODIFIERS=@im=fcitx\n" >> ~/.pam_environment
➖ autostart at every login ➖

For Xubuntu / XFCE4

  • just go on the Settings > Session and Startup > Application Autostart > + Add >
Name: fcitx
Command: /usr/bin/fcitx

For other distributions

  • Same concept but the location of the autostart configuration really varies from distribution to distribution…
  • see bottom

note:

it doesn’t seem to work with multiple latin and non latin im, just 1 at a time.


『ON ARCH LINUX』

In addition to fcitx also install:

  • fcitx-gtk2
  • fcitx-gtk3
  • fcitx-qt5
  • fcitx-qt6

or just install the group: fcitx-im.


『ON POP-OS』

You’ll probably already have the .pam_environment file so just append the code to the bottom or use the single command.
(don’t forget the double direction signs >> using only one would override your file.)

The autostart is located into “Startup Applications” you can reach it starting to type on the menu.
But still, this won’t be necessary since you can easily swap the input method and it will be auto started by default:

  • open the “Input Method” menu item.
  • answer “Yes” at the question “Do you explicitly select the user configuration?”
  • select fcitx and give ok.

you are now good to go :)

DEPRECATED .pam_environment workaround

If your distro has deprecated ~/.pam_environment and you are using startx to start the Xsession,
add these lines to the .xinitrc file:

export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export SDL_IM_MODULE=fcitx
export GLFW_IM_MODULE=ibus

before your last exec command.

(updated 2022 Oct, 23)

Not deprecated .pam_environment but no longer working

The @ symbol needs to be escaped \ like so

export XMODIFIERS="\@im=fcitx"

(updated 2022 Oct, 23)


Safe Creative

Help the author to continue publishing,
donate now or use an affiliate link.

⭐ Click here to choose ✨

You can also become an Affiliate for my content at this Link



  Made with Bulma   build with   Build with Hugo   hosted on the amazing Contabo and Vultr VPS

  © 2019 Francesco Yoshi Gobbo - PGP 3FC5F028E7AFF594 - ISNI 0000000502954809 - P.IVA / VAT: IT-01572520052

privacy policy | cookie policy