Repository navigation
Conversation
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.
Automated AI 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
Suggested change: before Reproducer (shows the issue at 5356386)Reviewed head: 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: #!/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())
PYActual output at the reviewed head: Same reproducer with the suggested change applied (two lines added before the existing More findingsDvorak/Colemak advice likely has no effectfcitx5 re-maps keys only when an input method's layout differs from the group's (fcitx5 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 keyWhen Dictation ( 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 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 layoutActual output: DetailsVerified (real fcitx5 5.1.22 on a private D-Bus bus, install and restart stubbed):
Related open PRs:
Review informationTest scope: Source and sandbox runs against real fcitx5 with stand-in engines, at 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. |
|
Thanks for this. I'm a native Korean speaker, and I tested the D-Bus part of
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:
Smaller one: fcitx5 silently drops engine names it hasn't discovered in
Tested and drafted with help from Claude (an Anthropic AI model). |
|
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 |
MoerAI
left a comment
There was a problem hiding this comment.
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 "") |
There was a problem hiding this comment.
[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." |
There was a problem hiding this comment.
[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." |
There was a problem hiding this comment.
[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.
|
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 This was checked against |
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-cjkalready renders Korean — but getting from there to typing 한글 means knowing toomarchy pkg add fcitx5-hangul, then openingfcitx5-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) installsfcitx5-hangul, restarts the supervised fcitx5 so it discovers the new engine, waits for it to answer, and appendshangulto the current input method group over D-Bus (org.fcitx.Fcitx.Controller1InputMethodGroupInfo→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.korean:ralt_hangul,korean:rctrl_hanjaxkb options for keyboards without dedicated keys, and the QWERTY layout Hangul needs on Dvorak or Colemak.test/shell.d/input-korean-test.shpins the exact D-Bus rewrite, idempotence, the stopped-fcitx5 failure path, and that the fcitx5 state probe stays out of the terminal;menu-test.shcovers the entry;test/acceptance.d/input-korean-test.shtypes Dubeolsikgksinto a terminal and expects한.What it deliberately doesn't do
Control+space,Zenkaku_HankakuandHangul(globalconfig.cpp), and xkb's sharedsymbols/pcmaps the 한/영 and 한자 keys toHangul/Hangul_Hanjaon every layout, so a Korean keyboard toggles out of the box andfcitx5-hangul's defaults (Dubeolsik, Hanja onHangul_Hanja/ F9) need nohangul.conf.--enable-wayland-imeis no longer needed: Chromium'skWaylandTextInputV3feature isENABLED_BY_DEFAULTandIsImeEnabled()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.This mirrors #9634 (one-step Japanese input) on purpose: same command shape, same D-Bus group rewrite, same
setup.input-methodparent, 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 barefcitx5-remote --checkprints 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
archlinuxcontainer (bind-mounted checkout, bash 5.3, jq 1.8, node 26):test/shell.d/input-korean-test.shSetInputMethodGroupInfo ssa(ss) Default us 3 keyboard-us "" keyboard-de de hangul ""+Save; hangul already present → no rewrite; fcitx5 down → exit 1, no busctl>/dev/null 2>&1fails the suite with the stray2test/shell.d/menu-test.sh,menu-guards-test.sh./test/cliomarchy setup input hangul --helprenders)./test/shellpkg-add/busctl/fcitx5-remoteomarchy setup input hangulNot verified:
test/acceptance.d/input-korean-test.shneeds theomarchy-isoVM 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.