Skip to content

Instantly share code, notes, and snippets.

@bus710
Last active April 7, 2024 01:03
Show Gist options
  • Save bus710/5bbe40535ebf492c19228129f9cdb15b to your computer and use it in GitHub Desktop.
Save bus710/5bbe40535ebf492c19228129f9cdb15b to your computer and use it in GitHub Desktop.

How to configure Sway, Fcitx, and Chrome for Korean IME

A brief note for Fcitx5 as the Korean Input Method in Debian Sid + Wayland + Sway

For more details: https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland


Steps

Install packages:

$ sudo apt install -y \
    fcitx5 \
    fcitx5-config-qt \
    fcitx5-hangul \
    qt5ct

# If need
$ sudo apt install -y \
        fonts-nanum \
        fonts-nanum-coding \
        fonts-noto-cjk 

Configure the env variables:

$ sudo vi /etc/environment # or ~/.profile

export GTK_IM_MODULE=fcitx # fcitx5 might show a warning if enable, but should be enabled for Chrome.
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export GLFW_IM_MODULE=ibus
export SDL_IM_MODULE=fcitx
export QT_SCALE_FACTOR=2 # for 4k monitors
export QT_QPA_PLATFORMTHEME=qt5ct

Add the fcitx daemon and Chrome launching parameters in the sway config:

$ vi ~/.config/sway/config

exec --no-startup-id fcitx5 -d
bindsym $mod+y exec google-chrome-stable --enable-features=UserOzonePlatform --ozone-platform=wayland --gtk-version=4 --enable-wayland-ime 

Update Chrome flags:

  1. Launch Chrome
  2. Open the flags page - chrome://flags
  3. Search for Preferred Ozone platform and configure it as Wayland

Fcitx5 and qt5ct configuration

Start the fcitx5-config-qt and configure it as needed.

  • Input Method: add Hangul and English(US)
  • Global Options:
    • Trigger Input Method: Control+Space or Shift+Space
    • Enumerate Input Method Forward: Control+Space or Shift+Space
    • Enumerate Input Method Backward: Empty
  • Apply and Save

Start the qt5ct and configure it as needed.

  • Appearance
    • Style: Fusion
    • Pallette: Custom
    • Color scheme: darker

Then reboot.


History

  • v0.0.1: initial note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment