Repository navigation
Keep Ctrl+Space for tmux and herdr after Korean input setup - #1
seunghan91 wants to merge 2 commits into
Conversation
fcitx5 switches input methods on Ctrl+Space by default, which is also Omarchy's tmux and herdr prefix. Once hangul joins the group, fcitx5 takes the chord first. Setup now drops every Ctrl+Space spelling from [Hotkey/TriggerKeys] and switches with the 한/영 key (Hangul) or Shift+Space, the keys ibus-hangul uses, keeping other trigger keys and settings. F9 is the voxtype dictation key, so Hanja is pointed at the 한자 key only. fcitx5 drops undiscovered engine names without an error, so the group is read back before setup reports success. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019giKJAi15aAheoMjWCsizr
Without a [Hotkey/TriggerKeys] section fcitx5 uses its built-in list, Control+space, Zenkaku_Hankaku and Hangul. Start from that list so only Ctrl+Space goes and the 全角/半角 key keeps switching. A bare TriggerKeys= under [Hotkey] is an explicit empty list and stays one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_019giKJAi15aAheoMjWCsizr
MoerAI
left a comment
There was a problem hiding this comment.
Thanks for this. Reviewed at db59104 against its base 5356386, and separately against current quattro (8a787b6).
Within its own scope the change holds up. An independent P0-P2 review found no actionable defect, and I reproduced the fix directly rather than trusting the tests: run against the base script, an existing [Hotkey/TriggerKeys] of Control+space, Super+space, Hangul came back unchanged; run against this branch, the same config became Super+space, Hangul, Shift+space with [Hotkey] and [Behavior] settings intact, a missing config became Zenkaku_Hankaku, Hangul, Shift+space, and a bare TriggerKeys= became Hangul, Shift+space. Every rerun left the file byte-identical. test/shell.d/input-korean-test.sh and test/cli were green, 117 assertions.
I am not merging it because it has been overtaken upstream, not because it is wrong:
- Its base PR omacom#11719 was closed unmerged on 2026-10-15 in favour of omacom#15508 ("Perfect Japanese, Chinese and Korean setups"), which merged into
quattrothe same day. Merging this intokorean-input-setupwould land in a branch that no longer has an upstream destination. - Both problems it fixes are already fixed on
quattro, by a different mechanism. Omarchy now shipsconfig/fcitx5/configwhose[Hotkey/TriggerKeys]isZenkaku_HankakuandHangul, under the comment "Omarchy binds Super+I. Leave Ctrl+Space to tmux/Herdr and other Super keys to the desktop." - so Ctrl+Space never becomes a trigger key in the first place. The manual now states thatCtrl + Spacestays available for Tmux and Herdr and that dictation push-to-talk stays on F9, so F9 is no longer advertised for Hanja either. - The files this PR edits are gone or rewritten upstream:
bin/omarchy-setup-input-hangulwas replaced by the genericbin/omarchy-setup-inputplusdefault/input-methods/presets.jsonandtyping_setup.py,test/shell.d/input-korean-test.shbytyping-setup-checks.pyandinput-method-checks.py, andmanual/34-keyboard-mouse-trackpad.mdwas rewritten. - Your Right Alt and 한자 point did land: omacom#15508 credits you as co-author and uses XKB
kr(kr104), and the manual documents 한/영 and 한자 working "whether your keyboard has dedicated keys or sends Right Alt and Right Ctrl". Thekb_optionsstring from this branch was not used becausequattrohad already removed that option.
So I plan to close this as superseded. If you think something here is still not covered on current quattro - a case the shipped defaults miss - say so and I will take that part upstream instead.
Proof limits, so this review is not read as more than it is: the above is CLI and config-file evidence from a disposable Linux container with a throwaway $HOME and stubbed package, service and D-Bus boundaries, plus upstream source read at quattro 8a787b6. I did not run native fcitx5, a compositor, a physical Korean keyboard, Hanja conversion, or the full ./test/all. Your own sway, foot and tmux results remain your evidence, not mine.
| # Shift+Space, the same keys ibus-hangul uses. Other trigger keys and settings | ||
| # stay; the trigger list is rewritten as one section at the end of the file. | ||
| # fcitx5 reads this file when it starts, which the restart below takes care of. | ||
| fcitx5_config="$HOME/.config/fcitx5/config" |
There was a problem hiding this comment.
[note] This is the one durable design difference, and upstream has now settled it the other way.
This block rewrites a user-owned file: it drops every Ctrl+Space spelling, normalises quoting and CRLF, and re-emits [Hotkey/TriggerKeys] as a single section moved to the end of ~/.config/fcitx5/config. quattro reaches the same end state by shipping config/fcitx5/config with Ctrl+Space absent from [Hotkey/TriggerKeys] and leaving the user's own file alone; its setup command even reports that existing custom Fcitx keys are preserved.
The AWK parsing itself matched fcitx5's INI reader in my runs - trimmed lines, CRLF, quoted values, repeated sections merged by index, and a bare TriggerKeys= treated as an explicit empty list. So this is about where the setting belongs, not about the parser.
|
Agreed, this is superseded by omacom#15508: the shipped Fcitx defaults keep Ctrl+Space out of the trigger keys without touching the user's file, and the F9 hint is gone. Thanks for the careful review and for checking the parser behaviour. Closing. |
Follow-up to my comment on omacom#11719: two commits on top of
korean-input-setupthat address the shortcut conflicts, so setup leaves nothing to fix by hand.[Hotkey/TriggerKeys]in~/.config/fcitx5/config: it drops every Ctrl+Space spelling fcitx5 accepts (Control+space,CTRL_SPACE,Control+SPACE, quoted or not) and makes sureHangulandShift+spaceare there. Those are the keys ibus-hangul uses, so keyboards without a 한/영 key still have a toggle. Other trigger keys and every other setting stay. With no trigger list configured, it starts from fcitx5's built-in one, soZenkaku_Hankakukeeps working; a bareTriggerKeys=stays an empty list. The file is read the way fcitx5's INI parser reads it (trimmed lines, CRLF, quoted values, repeated sections merged by index), and the trigger list is written back as one section at the end.default/hypr/bindings/voxtype.luabinds it for dictation. The message and manual point to the 한자 key.Tests:
test/shell.d/input-korean-test.shgains the trigger rewrite on a fresh config (keepingZenkaku_Hankaku), a bareTriggerKeys=, a rerun, an existing config with other sections, a CRLF/duplicate-section/alias fixture, and the read-back failure. It passes on Arch with bash 5../test/allthere shows the same failures askorean-input-setupitself, all environment-related (nonode,updatedboromarchy-pkgscheckout), and two more passing tests.End to end, with the real script against fcitx5 5.1.23 and fcitx5-hangul 5.1.11 on a profile in its fresh-install state, driven through fcitx5's D-Bus input context:
keyboard-us↔hangul.gksrmf→ 한글,dkssud→ 안녕.Through a real compositor as well: headless sway 1.12 → fcitx5 over input-method-v2 → foot → tmux with Omarchy's
C-Spaceprefix, keys sent withwtype, andCtrl+Space,cas the probe (tmux opens a second window when it gets the prefix):Ctrl+Space,cgksrmf␣after Shift+Spacekeyboard-usgksrmfkeyboard-us+hangul, fcitx5 default triggers (this PR as-is)hangul, and thecwas typed asㅊ한글keyboard-us+hangul, triggers from this commitkeyboard-us한글So without the trigger change, setting up Korean takes the tmux/herdr prefix away; with it, both work. sway stands in for Hyprland here (Hyprland 0.56 has no headless backend). A physical Korean keyboard is still on my list.
Written and tested with help from Claude (an Anthropic AI model).