Skip to content

Add one-step Korean input setup - #11719

Closed
MoerAI wants to merge 2 commits into
omacom:quattrofrom
MoerAI:korean-input-setup
Closed

MoerAI wants to merge 2 commits into
omacom:quattrofrom
MoerAI:korean-input-setup

Conversation

@MoerAI

@MoerAI MoerAI commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Korean users land on an Omarchy that can't type Hangul. The pieces are all there — fcitx5 runs in every session for the CapsLock compose sequences, and noto-fonts-cjk already renders Korean — but getting from there to typing 한글 means knowing to omarchy pkg add fcitx5-hangul, then opening fcitx5-configtool (which the launcher hides) to add the engine to the input method group. Windows and macOS finish setup with a working Korean IME; this closes that gap in one step.

What this does

  • omarchy-setup-input-hangul (omarchy setup input hangul) installs fcitx5-hangul, restarts the supervised fcitx5 so it discovers the new engine, waits for it to answer, and appends hangul to the current input method group over D-Bus (org.fcitx.Fcitx.Controller1 InputMethodGroupInfo → SetInputMethodGroupInfo → Save). Existing engines stay in place, and a rerun is a no-op on the group. Without a desktop session it says so and exits 1 rather than touching anything.
  • Setup > Input Method > Hangul (Korean) in the Omarchy menu runs it in the presentation terminal.
  • Manual: a Typing in Korean section under Keyboard, Mouse, Trackpad — the 한/영 / Ctrl+Space toggle, the 한자 / F9 Hanja key, the korean:ralt_hangul,korean:rctrl_hanja xkb options for keyboards without dedicated keys, and the QWERTY layout Hangul needs on Dvorak or Colemak.
  • Tests: test/shell.d/input-korean-test.sh pins the exact D-Bus rewrite, idempotence, the stopped-fcitx5 failure path, and that the fcitx5 state probe stays out of the terminal; menu-test.sh covers the entry; test/acceptance.d/input-korean-test.sh types Dubeolsik gks into a terminal and expects 한.

What it deliberately doesn't do

  • No global fcitx5 config is written. fcitx5's stock trigger keys are Control+space, Zenkaku_Hankaku and Hangul (globalconfig.cpp), and xkb's shared symbols/pc maps the 한/영 and 한자 keys to Hangul / Hangul_Hanja on every layout, so a Korean keyboard toggles out of the box and fcitx5-hangul's defaults (Dubeolsik, Hanja on Hangul_Hanja / F9) need no hangul.conf.
  • No Chromium/Electron flags. --enable-wayland-ime is no longer needed: Chromium's kWaylandTextInputV3 feature is ENABLED_BY_DEFAULT and IsImeEnabled() returns true when it is on (ui_base_features.cc, wayland_input_method_context.cc), so the Chromium Omarchy ships already talks text-input-v3 to Hyprland and on to fcitx5. The Arch wiki guidance predates that change.
  • No locale, translation, install-time keyboard choice (Offer Korean as an install-time keyboard choice #9299) or bar indicator — those are separate concerns with their own PRs.

This mirrors #9634 (one-step Japanese input) on purpose: same command shape, same D-Bus group rewrite, same setup.input-method parent, so both can land and the menu reads Input Method > Hangul (Korean) / Mozc (Japanese). If #9634 goes first, the only conflict is the identical parent line. One thing found here that applies there too: a bare fcitx5-remote --check prints the input state (2) on stdout once fcitx5 answers, so the readiness probe has to be silenced or the presentation terminal shows a stray digit.

Verification

Run in an archlinux container (bind-mounted checkout, bash 5.3, jq 1.8, node 26):

Check Result
test/shell.d/input-korean-test.sh 3 ok: fresh group gets SetInputMethodGroupInfo ssa(ss) Default us 3 keyboard-us "" keyboard-de de hangul "" + Save; hangul already present → no rewrite; fcitx5 down → exit 1, no busctl
Regression check for the probe fix Reverting only the >/dev/null 2>&1 fails the suite with the stray 2
test/shell.d/menu-test.sh, menu-guards-test.sh Pass
./test/cli Pass (metadata lint, omarchy setup input hangul --help renders)
./test/shell No new failures versus the same container before the change
Command stdout with stubbed pkg-add/busctl/fcitx5-remote Exactly the two ready lines, exit 0, directly and via omarchy setup input hangul

Not verified: test/acceptance.d/input-korean-test.sh needs the omarchy-iso VM harness and was only syntax-checked; the full command against a live fcitx5 was exercised through stubs that answer with the real D-Bus shapes.

Omarchy already runs fcitx5 in every session for the CapsLock compose
sequences, so Korean was only ever an engine and a group entry away --
but reaching it meant installing fcitx5-hangul by hand and wiring it in
through fcitx5-configtool, which the launcher hides.

Setup > Input Method > Hangul (Korean) now installs fcitx5-hangul,
restarts the supervised fcitx5 so it discovers the engine, and appends
hangul to the current input method group over D-Bus, leaving any engine
the user added earlier in place. fcitx5's stock trigger keys already
include the Hangul keysym the 한/영 key emits, so no global config is
written; Ctrl+Space covers keyboards without one.

The manual covers the toggle and Hanja keys, the xkb options that put
한/영 and 한자 on Right Alt and Right Ctrl for keyboards without them,
and the QWERTY layout Hangul needs on Dvorak or Colemak.
Runs the setup command, checks fcitx5-hangul is installed and registered
with fcitx5, then types Dubeolsik g k s into a terminal and expects 한
back. Skips when the package is missing and no sudo password is
provided, the way the sshd hardening exercise does.
@llstrk

llstrk commented Oct 1, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: If the group's default engine is already another one (for example Mozc from #9634), the 한/영 key and Ctrl+Space still switch to it after setup.

Toggle keys still reach the engine added before Hangul

SetInputMethodGroupInfo keeps an existing default that is not the group's first entry (fcitx5 inputmethodgroup.cpp:93-114), and the trigger keys activate that default. Impact: in the coexistence case the script comment describes, the printed toggle hint selects Mozc, not Hangul. #9634 and #12312 share this code.

Suggested change: before Save, call Controller1 SetCurrentIM s hangul then Deactivate (tested: the default becomes hangul and survives a restart), which makes Hangul the toggle target instead of the earlier engine; alternatively, keep the default and print accurate guidance.

Reproducer (shows the issue at 5356386)

Reviewed head: 53563868319c38745350954668b8d9f001b99a62. Runs a throwaway fcitx5 on a private D-Bus bus; Mozc and Hangul are registration files only (no engine libraries), which is enough for fcitx5 to accept them in a group and switch to them. The omarchy-pkg-add and omarchy-restart-xcompose steps are no-op stubs because the engine is already registered.

Environment of the recorded run: fcitx5 5.1.22, busctl (systemd 261), jq 1.8.2, Python 3.14 with dbus-python, inside an isolated sandbox.

Run from the PR checkout: bash repro-toggle-target.sh bin/omarchy-setup-input-hangul

#!/bin/bash
# Reproducer: after omarchy-setup-input-hangul runs in a group that already has
# another engine (Mozc here), the 한/영 key and Ctrl+Space still switch to that
# engine, not to Hangul. Uses a throwaway fcitx5 on a private D-Bus bus; the
# Mozc and Hangul engines are registration files only (no engine libraries).
# Needs: fcitx5 5.1.x, dbus-daemon, busctl, jq, python3 with dbus-python.
# Touches nothing outside its own mktemp directory and private bus.
# Usage: bash repro-toggle-target.sh path/to/bin/omarchy-setup-input-hangul
set -u
script=$(realpath "$1")
tmp=$(mktemp -d)
fcitx_pid= bus_pid=
trap 'kill "$fcitx_pid" "$bus_pid" 2>/dev/null; wait 2>/dev/null; rm -rf "$tmp"' EXIT
mkdir -p "$tmp/home/.config/fcitx5" "$tmp/home/.local/share/fcitx5/addon" \
  "$tmp/home/.local/share/fcitx5/inputmethod" "$tmp/bin" "$tmp/run"
chmod 700 "$tmp/run"

for im in hangul:Hangul:ko mozc:Mozc:ja; do
  IFS=: read -r id name lang <<<"$im"
  printf '[Addon]\nName=%s\nCategory=InputMethod\nLibrary=%s\nType=SharedLibrary\nOnDemand=True\n' \
    "$name" "$id" >"$tmp/home/.local/share/fcitx5/addon/$id.conf"
  printf '[InputMethod]\nName=%s\nAddon=%s\nLangCode=%s\n' \
    "$name" "$id" "$lang" >"$tmp/home/.local/share/fcitx5/inputmethod/$id.conf"
done

# The group a user has after setting up Japanese first: English, then Mozc.
cat >"$tmp/home/.config/fcitx5/profile" <<'PROFILE'
[Groups/0]
Name=Default
Default Layout=us
DefaultIM=mozc

[Groups/0/Items/0]
Name=keyboard-us
Layout=

[Groups/0/Items/1]
Name=mozc
Layout=

[GroupOrder]
0=Default
PROFILE

# The engine is already registered, so installing and restarting are no-ops.
printf '#!/bin/bash\n' >"$tmp/bin/omarchy-pkg-add"
printf '#!/bin/bash\n' >"$tmp/bin/omarchy-restart-xcompose"
chmod +x "$tmp/bin/"*

cat >"$tmp/bus.conf" <<CONF
<busconfig><type>session</type><listen>unix:path=$tmp/bus</listen><auth>EXTERNAL</auth>
<policy context="default"><allow send_destination="*" eavesdrop="true"/><allow eavesdrop="true"/><allow own="*"/></policy></busconfig>
CONF

run() {
  env -i PATH="$tmp/bin:/usr/bin:/bin" HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/home/.config" \
    XDG_DATA_HOME="$tmp/home/.local/share" XDG_RUNTIME_DIR="$tmp/run" LANG=C.UTF-8 \
    DBUS_SESSION_BUS_ADDRESS="unix:path=$tmp/bus" "$@"
}

dbus-daemon --config-file="$tmp/bus.conf" --nofork --print-address=1 >/dev/null &
bus_pid=$!
for _ in {1..100}; do [[ -S $tmp/bus ]] && break; sleep 0.05; done
start_fcitx5() { # direct background job, so $! is fcitx5 itself
  env -i PATH=/usr/bin:/bin HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/home/.config" \
    XDG_DATA_HOME="$tmp/home/.local/share" XDG_RUNTIME_DIR="$tmp/run" LANG=C.UTF-8 \
    DBUS_SESSION_BUS_ADDRESS="unix:path=$tmp/bus" \
    fcitx5 --disable=wayland,waylandim,xcb,xim,classicui,kimpanel,notificationitem,notifications \
    >>"$tmp/fcitx5.log" 2>&1 &
  fcitx_pid=$!
}
start_fcitx5
for _ in {1..100}; do run fcitx5-remote --check >/dev/null 2>&1 && break; sleep 0.05; done
run fcitx5-remote --check >/dev/null 2>&1 || { echo "fcitx5 did not start" >&2; exit 1; }

echo "--- setup script output"
run bash "$script"
echo "--- exit status: $?"

run python3 -B - <<'PY'
import dbus
bus = dbus.SessionBus()
svc = 'org.fcitx.Fcitx5'
ctl = dbus.Interface(bus.get_object(svc, '/controller'), 'org.fcitx.Fcitx.Controller1')
info = ctl.FullInputMethodGroupInfo('')
print('group items:', [str(e[0]) for e in info[4]])
print('toggle target (DefaultIM):', info[1])
im = dbus.Interface(bus.get_object(svc, '/org/freedesktop/portal/inputmethod'),
                    'org.fcitx.Fcitx.InputMethod1')
path, _ = im.CreateInputContext(dbus.Array([dbus.Struct(('program', 'repro'), signature='ss')], signature='(ss)'))
ic = dbus.Interface(bus.get_object(svc, path), 'org.fcitx.Fcitx.InputContext1')
ic.FocusIn()
def key(sym, code, state, release):
    ic.ProcessKeyEvent(dbus.UInt32(sym), dbus.UInt32(code), dbus.UInt32(state), dbus.Boolean(release), dbus.UInt32(0))
key(0xff31, 130, 0, False); key(0xff31, 130, 0, True)          # Hangul keysym (한/영 key)
print('after 한/영 key:', ctl.CurrentInputMethod())
key(0xff31, 130, 0, False); key(0xff31, 130, 0, True)          # back to English
key(0xffe3, 37, 0, False); key(0x20, 65, 4, False)             # Ctrl+Space
key(0x20, 65, 4, True); key(0xffe3, 37, 4, True)
print('after Ctrl+Space:', ctl.CurrentInputMethod())
PY

Actual output at the reviewed head:

--- setup script output
Korean input is ready. Press the 한/영 key or Ctrl+Space to switch between English and Korean.
While typing Korean, press the 한자 key or F9 to convert to Hanja.
--- exit status: 0
group items: ['keyboard-us', 'mozc', 'hangul']
toggle target (DefaultIM): mozc
after 한/영 key: mozc
after Ctrl+Space: mozc

Same reproducer with the suggested change applied (two lines added before the existing Save call: busctl --user call org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1 SetCurrentIM s hangul and ... Deactivate):

--- setup script output
Korean input is ready. Press the 한/영 key or Ctrl+Space to switch between English and Korean.
While typing Korean, press the 한자 key or F9 to convert to Hanja.
--- exit status: 0
group items: ['keyboard-us', 'mozc', 'hangul']
toggle target (DefaultIM): hangul
after 한/영 key: hangul
after Ctrl+Space: hangul
More findings

Dvorak/Colemak advice likely has no effect

fcitx5 re-maps keys only when an input method's layout differs from the group's (fcitx5 instance.cpp:536-566), and the group fcitx5 builds for itself on Omarchy has layout us, so English (US) for Hangul changes nothing. Impact: Dvorak/Colemak users who follow the paragraph would still get the wrong jamo. Mechanism reproduced with a stand-in engine, not on a Dvorak session.

Suggested change: check on a Dvorak session; if confirmed, set the group's layout and its first keyboard entry to the real layout (for example Keyboard - English (Dvorak)) before giving Hangul English (US), or drop the paragraph. Reproducer in the next block.

F9 is the Dictation key

When Dictation (voxtype) is installed, default/hypr/bindings/voxtype.lua binds a plain F9, and Hyprland consumes bound keys before the input method. Impact: the "or F9" Hanja alternative in the script output and the manual starts dictation on those machines instead (source reading only). Suggested change: name only the 한자 key, or mention the Dictation conflict.

Reproducer: Dvorak/Colemak layout mechanism (stand-in engine)

Relates to the manual paragraph "on Dvorak or Colemak give Hangul its own QWERTY layout ... set its layout to English (US)". A Dvorak keyboard sends keysym i for the physical G key (keycode 42); Dubeolsik needs g there. fcitx5 re-maps keys for an input method only when that input method's own layout differs from the group's Default Layout. A loaded stand-in engine (keyboard-gb) carries the per-input-method layout us in Hangul's place, so fcitx5's own pass-through shows whether it re-mapped the key. Not run against a real fcitx5-hangul or a Hyprland Dvorak session.

Environment of the recorded run: fcitx5 5.1.22, Python 3.14 with dbus-python and PyGObject, inside an isolated sandbox.

#!/bin/bash
# Reproducer for the manual's Dvorak/Colemak advice (give Hangul the layout
# English (US)). fcitx5 re-maps keys for an input method only when that input
# method's own layout differs from the group's Default Layout. A Dvorak
# keyboard sends keysym "i" for the physical G key (keycode 42); Hangul needs
# "g" there. A loaded stand-in engine (keyboard-gb) carries the per-input-method
# layout "us" in Hangul's place, so fcitx5's pass-through shows whether it
# re-mapped the key. Throwaway fcitx5 on a private D-Bus bus; touches nothing
# outside its own mktemp directory.
# Needs: fcitx5 5.1.x, dbus-daemon, python3 with dbus-python and PyGObject.
set -u
tmp=$(mktemp -d)
fcitx_pid= bus_pid=
trap 'kill "$fcitx_pid" "$bus_pid" 2>/dev/null; wait 2>/dev/null; rm -rf "$tmp"' EXIT
mkdir -p "$tmp/home/.config/fcitx5" "$tmp/run"
chmod 700 "$tmp/run"
cat >"$tmp/bus.conf" <<CONF
<busconfig><type>session</type><listen>unix:path=$tmp/bus</listen><auth>EXTERNAL</auth>
<policy context="default"><allow send_destination="*" eavesdrop="true"/><allow eavesdrop="true"/><allow own="*"/></policy></busconfig>
CONF

run() {
  env -i PATH=/usr/bin:/bin HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/home/.config" \
    XDG_DATA_HOME="$tmp/home/.local/share" XDG_RUNTIME_DIR="$tmp/run" LANG=C.UTF-8 \
    DBUS_SESSION_BUS_ADDRESS="unix:path=$tmp/bus" "$@"
}

dbus-daemon --config-file="$tmp/bus.conf" --nofork --print-address=1 >/dev/null &
bus_pid=$!
for _ in {1..100}; do [[ -S $tmp/bus ]] && break; sleep 0.05; done

try() { # group Default Layout, first (English) entry
  cat >"$tmp/home/.config/fcitx5/profile" <<PROFILE
[Groups/0]
Name=Default
Default Layout=$1
DefaultIM=keyboard-gb

[Groups/0/Items/0]
Name=$2
Layout=

[Groups/0/Items/1]
Name=keyboard-gb
Layout=us

[GroupOrder]
0=Default
PROFILE
  env -i PATH=/usr/bin:/bin HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/home/.config" \
    XDG_DATA_HOME="$tmp/home/.local/share" XDG_RUNTIME_DIR="$tmp/run" LANG=C.UTF-8 \
    DBUS_SESSION_BUS_ADDRESS="unix:path=$tmp/bus" \
    fcitx5 --disable=wayland,waylandim,xcb,xim,classicui,kimpanel,notificationitem,notifications \
    >>"$tmp/fcitx5.log" 2>&1 &
  fcitx_pid=$!   # direct background job, so this is fcitx5 itself
  for _ in {1..100}; do run fcitx5-remote --check >/dev/null 2>&1 && break; sleep 0.05; done
  echo "--- group Default Layout=$1; second input method's own layout=us"
  run python3 -B - <<'PY'
import dbus
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
svc = 'org.fcitx.Fcitx5'
ctl = dbus.Interface(bus.get_object(svc, '/controller'), 'org.fcitx.Fcitx.Controller1')
im = dbus.Interface(bus.get_object(svc, '/org/freedesktop/portal/inputmethod'),
                    'org.fcitx.Fcitx.InputMethod1')
path, _ = im.CreateInputContext(dbus.Array([dbus.Struct(('program', 'repro'), signature='ss')], signature='(ss)'))
commits = []
bus.add_signal_receiver(lambda s: commits.append(str(s)), 'CommitString',
                        'org.fcitx.Fcitx.InputContext1', None, path)
ic = dbus.Interface(bus.get_object(svc, path), 'org.fcitx.Fcitx.InputContext1')
ic.FocusIn()
def key(sym, code, release):
    return bool(ic.ProcessKeyEvent(dbus.UInt32(sym), dbus.UInt32(code), dbus.UInt32(0),
                                   dbus.Boolean(release), dbus.UInt32(0)))
key(0xff31, 130, False); key(0xff31, 130, True)   # 한/영 (Hangul keysym): activate
print('active input method:', ctl.CurrentInputMethod())
remapped = key(ord('i'), 42, False); key(ord('i'), 42, True)
ctx = GLib.MainContext.default()
end = GLib.get_monotonic_time() + 300000
while GLib.get_monotonic_time() < end:
    ctx.iteration(False)
print('G key sends "i": fcitx5 re-mapped it:', remapped, '| committed:', commits)
PY
  kill "$fcitx_pid" && wait "$fcitx_pid" 2>/dev/null
  run fcitx5-remote --check >/dev/null 2>&1 && { echo "previous fcitx5 still answering" >&2; exit 1; }
  fcitx_pid=
}

try us keyboard-us                 # the Default Layout fcitx5 builds for itself on Wayland
try us-dvorak keyboard-us-dvorak   # Default Layout names the real layout

Actual output:

--- group Default Layout=us; second input method's own layout=us
active input method: keyboard-gb
G key sends "i": fcitx5 re-mapped it: False | committed: []
--- group Default Layout=us-dvorak; second input method's own layout=us
active input method: keyboard-gb
G key sends "i": fcitx5 re-mapped it: True | committed: ['g']
Details

Verified (real fcitx5 5.1.22 on a private D-Bus bus, install and restart stubbed):

  • D-Bus signatures and the busctl --json=short shape match fcitx5; existing item layouts are carried over.
  • With several groups, only the current group changes; a rerun leaves the group unchanged.
  • The readiness loop covers the restart gap; with fcitx5 down the script exits 1 without calling busctl.
  • The PR's shell and menu tests pass at the head and merged onto current quattro; the shell test catches 6 of 7 mutants.

Related open PRs:


Review information

Test scope: Source and sandbox runs against real fcitx5 with stand-in engines, at 5356386; no acceptance test or live Hyprland session.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@seunghan91

seunghan91 commented Oct 6, 2026 •

Copy link
Copy Markdown

Thanks for this. I'm a native Korean speaker, and I tested the D-Bus part of omarchy-setup-input-hangul from 5356386 against a profile in the state a fresh Omarchy install leaves it: no ~/.config/fcitx5/profile, only Omarchy's shipped conf/clipboard.conf and conf/xcb.conf. I used fcitx5 5.1.23 and fcitx5-hangul 5.1.11 on an aarch64 Omarchy guest, in an isolated XDG_CONFIG_HOME under dbus-run-session. I sent keys through fcitx5's D-Bus input-context frontend, not a compositor, so this checks the setup step and the engine, not Hyprland's input path.

  • Before: group Default = keyboard-us only.
  • First run: rc 0, group became keyboard-us, hangul, and the saved profile has both items. A second run left the group unchanged.
  • gksrmf typed as plain US. The Hangul keysym (0xff31) switched to hangul, and gksrmf committed 한글. Hangul again went back to keyboard-us. Ctrl+Space also switched.
  • gks + F9 opened Hanja candidates, and Return committed 韓.

So the D-Bus rewrite works on a clean profile, and the real engine composes as expected. Three things stood out when I compared the instructions with Omarchy's defaults; the first isn't in llstrk's review above, and the other two agree with it:

  1. Ctrl+Space is also Omarchy's terminal prefix. config/tmux/tmux.conf:2 and config/herdr/config.toml:18 use C-Space. Once fcitx5 handles a terminal's input, its default Ctrl+Space trigger takes the key before tmux or herdr sees it, and the script and manual both point users to it. Update: I checked this through a real compositor (headless sway → fcitx5 over input-method-v2 → foot → tmux with the C-Space prefix). After this PR's setup, Ctrl+Space, c switched to Hangul instead of reaching tmux, and the c came out as ㅊ. With Control+space removed from the trigger list, the prefix worked and Hangul still typed. Details in Keep Ctrl+Space for tmux and herdr after Korean input setup MoerAI/omarchy#1. Since 한/영 already works through the Hangul keysym, which is one of fcitx5's default trigger keys, could setup drop Control+space from [Hotkey/TriggerKeys] in ~/.config/fcitx5/config, keeping Hangul (and Zenkaku_Hankaku), and could the manual point keyboards without a 한/영 key to korean:ralt_hangul instead of Ctrl+Space? That is also how Korean Windows users switch.
  2. F9 is the voxtype dictation key. default/hypr/bindings/voxtype.lua:3-4 binds F9 press and release globally, so with dictation installed, F9 never reaches fcitx5. I'd mention only the 한자 key / korean:rctrl_hanja for Hanja, as the review above also suggests.
  3. An existing default engine stays the toggle target. Appending hangul keeps the group's previous DefaultIM. For someone who already added Mozc or Pinyin, 한/영 toggles that engine instead of Hangul. Setting DefaultIM to hangul, or noting it in the manual, would make "press 한/영" true for them too. The review above has a reproducer and a tested fix for this (SetCurrentIM hangul then Deactivate before Save).

Smaller one: fcitx5 silently drops engine names it hasn't discovered in SetInputMethodGroupInfo, so if the running instance hasn't picked up hangul, the script still prints "Korean input is ready." Reading the group back before printing that would catch it. The extra Save call is redundant, since the setter already saves.

git merge-tree shows no conflicts against current quattro (81145eb). I'm setting up a clean x86 install with a Korean keyboard and will report the real 한/영 / 한자 keys, Chromium, and tmux behavior there. Happy to turn any of the above into a suggested diff if that helps.

Tested and drafted with help from Claude (an Anthropic AI model).

@seunghan91

Copy link
Copy Markdown

I turned the three points above into one commit against this branch: MoerAI#1. It keeps Ctrl+Space for tmux/herdr (switching with 한/영 or Shift+Space instead), drops the F9 hint, and reads the group back before reporting success. Tests are included. Merge it into korean-input-setup if it looks right, or cherry-pick whatever is useful.

@MoerAI MoerAI left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted author-side code review of 5356386, combining a complete independent structured review with direct verification. Three actionable findings need attention before merging: the existing default can remain the toggle target, setup intercepts the default terminal prefix, and the F9 guidance conflicts with dictation.

Verification: all three input-korean shell cases, menu and menu-guards checks, the complete CLI suite (112 assertions), shell syntax and diff whitespace checks passed. On actual Arch fcitx5 5.1.23 / fcitx5-hangul 5.1.11, fresh registration and an idempotent rerun worked. Real D-Bus key events confirmed Ctrl+Space changes from forwarded before setup to consumed after setup. An ordinary-user group with keyboard-us and keyboard-de retained keyboard-de as DefaultIM after Hangul was appended; both advertised toggles still selected keyboard-de. A real Mozc group likewise retained DefaultIM=mozc, although its backend key activation timed out in emulation, so that particular key run is not claimed as passing. The F9 issue is source-confirmed, not a live compositor test.

These findings confirm concerns already raised in the discussion; this review pins them to the current head with independently checked evidence. An additional disabled-addon registration hypothesis did not reproduce and is not included as a finding.

Limits: no graphical acceptance/physical Korean-keyboard, live Hyprland F9, browser/Electron input, Dvorak/Colemak or full aggregate-suite proof. GitHub currently reports merge conflicts with quattro and no status checks. This COMMENT review is not a maintainer approval; no code was changed or merged.

IFS=$'\t' read -r name item_layout <<<"$input_method"
args+=("$name" "$item_layout")
done
args+=(hangul "")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Make the advertised toggle reach Hangul in an existing group

Appending the entry does not change an existing DefaultIM: SetInputMethodGroupInfo rebuilds the list, while InputMethodManager::setGroup preserves the previous default. On actual Arch fcitx5 5.1.23, an ordinary-user group [keyboard-us, keyboard-de] became [keyboard-us, keyboard-de, hangul], but its saved default remained keyboard-de and both actual Hangul and Ctrl+Space key events selected keyboard-de instead of Hangul. A Mozc group also retained DefaultIM=mozc. The command therefore reports Korean ready even though its advertised switch does not reach Korean in this supported coexistence case. Explicitly select a usable Hangul toggle target, or provide an accurate selection flow for existing defaults rather than promising the current keys work unconditionally.

Relevant upstream contract: https://github.com/fcitx/fcitx5/blob/master/src/lib/fcitx/inputmethodmanager.cpp#L336-L363


# The 한/영 key sends the Hangul keysym, which fcitx5 already treats as a
# toggle out of the box, alongside Ctrl+Space for keyboards without one.
echo "Korean input is ready. Press the 한/영 key or Ctrl+Space to switch between English and Korean."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve the shipped terminal prefixes when enabling Hangul

With a fresh keyboard-only group, the real fcitx input context forwarded Ctrl+Space. After this setup added Hangul, the same key event was consumed and selected Hangul. That prevents it from reaching the unchanged primary prefix in config/tmux/tmux.conf:2 (C-Space) and config/herdr/config.toml:18 (ctrl+space). The setup needs a trigger compatible with those shipped bindings rather than unconditionally recommending Ctrl+Space. The existing shell mock does not exercise this interception.

# The 한/영 key sends the Hangul keysym, which fcitx5 already treats as a
# toggle out of the box, alongside Ctrl+Space for keyboards without one.
echo "Korean input is ready. Press the 한/영 key or Ctrl+Space to switch between English and Korean."
echo "While typing Korean, press the 한자 key or F9 to convert to Hanja."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Do not advertise F9 as an unconditional Hanja fallback

When voxtype is installed, default/hypr/bindings/voxtype.lua:3-4 already globally maps F9 press/release to starting and stopping dictation. This is a supported configuration in which the advertised Hanja fallback conflicts with another desktop action. Prefer the dedicated Hangul_Hanja key/right-Control remap, or document and resolve the dictation conflict; update the matching manual guidance too. This finding is based on the shipped bindings, not a claimed live Hyprland F9 test.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this. The work is carried forward in #15508, which brings the still-missing parts of Japanese, Chinese and Korean setup together into one change, so I am closing this in its favour.

Most of this is now on quattro: omarchy setup input hangul (#14433) installs the engine, adds it with readback and rollback and seeds Korean glyphs, and Omarchy's input defaults keep Ctrl+Space out of Fcitx's trigger keys. Your Right Alt point is in #15508, credited to you as co-author: a second installer row, "Korean (Right Alt switches Hangul)", uses XKB's kr(kr104) so keyboards whose 한/영 and 한자 keys send Right Alt and Right Ctrl switch to Hangul. The kb_options string from this branch would have brought back an option quattro has since removed, so that part was not used.

This was checked against quattro by Claude, with Codex at medium effort verifying the claims above. If something here is not covered after all, say so and this can be reopened.

@omarchybot omarchybot closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants