Repository navigation
Conversation
Automated AI review
Verified: at Verified (sandboxed runs and source reading):
|
|
Thanks for the thorough review! Pushed fixes as separate commits:
On the related PRs: this command sets more than the input method (locale and interface font too), so I kept it as |
Automated AI review
Outcome: At On JIS, the vconsole layout usually no longer reaches the fcitx5 profilefcitx5 saves its profile when Suggested change: when the group holds a single Reproducer (fails at 03b18a5, passes at 2d81b16)The #!/bin/bash
# fcitx5 writes its in-memory profile when it exits (Instance's exit event calls
# save(), and SIGTERM from `systemctl --user stop` triggers it). On a session
# where fcitx5 is running, stop_fcitx5 therefore leaves fcitx5's own profile on
# disk before setup_input_method looks at it. Without customisation that is the
# stock single keyboard-us group fcitx5 builds when it cannot read an X11 layout.
# This stubs systemctl to do the same, then runs the command on a JIS layout.
set -euo pipefail
source "$(dirname "$0")/base-test.sh"
test_dir=$(mktemp -d)
trap 'rm -rf "$test_dir"' EXIT
stub_bin="$test_dir/bin"
mkdir -p "$stub_bin"
cat >"$stub_bin/systemctl" <<'STUB'
#!/bin/bash
profile="$HOME/.config/fcitx5/profile"
if [[ $* == "--user stop omarchy-fcitx5.service" && ! -f $profile ]]; then
mkdir -p "${profile%/*}"
cat >"$profile" <<'EOF'
[Groups/0]
# Group Name
Name=Default
# Layout
Default Layout=us
# Default Input Method
DefaultIM=keyboard-us
[Groups/0/Items/0]
# Name
Name=keyboard-us
# Layout
Layout=
[GroupOrder]
0=Default
EOF
fi
STUB
# The same JIS layout for heads that read it from localectl instead.
cat >"$stub_bin/localectl" <<'STUB'
#!/bin/bash
echo " System Locale: LANG=en_US.UTF-8"
echo " X11 Layout: jp"
STUB
for cmd in omarchy-pkg-add pkill sudo gsettings; do
printf '#!/bin/bash\nexit 0\n' >"$stub_bin/$cmd"
done
printf '#!/bin/bash\nexit 1\n' >"$stub_bin/gum"
chmod +x "$stub_bin"/*
home="$test_dir/home"
mkdir -p "$home"
printf 'KEYMAP=jp106\nXKBLAYOUT=jp\n' >"$test_dir/vconsole.conf"
HOME="$home" PATH="$stub_bin:$PATH" OMARCHY_VCONSOLE_PATH="$test_dir/vconsole.conf" \
bash "$ROOT/bin/omarchy-setup-japanese" >"$test_dir/out" 2>&1 ||
fail "setup japanese runs" "$(<"$test_dir/out")"
profile=$(<"$home/.config/fcitx5/profile")
printf -- '--- command output ---\n%s\n--- resulting profile ---\n%s\n---\n' "$(<"$test_dir/out")" "$profile"
grep -Fx 'Default Layout=jp' <<<"$profile" >/dev/null &&
grep -Fx 'Name=keyboard-jp' <<<"$profile" >/dev/null &&
grep -Fx 'Name=mozc' <<<"$profile" >/dev/null ||
fail "a JIS keyboard gets Mozc after keyboard-jp when fcitx5 saved its stock profile on stop"
pass "a JIS keyboard gets Mozc after keyboard-jp when fcitx5 saved its stock profile on stop"Actual output at Actual output at DetailsMechanism (fcitx5 5.1.23 source): SIGTERM from Verified (sandbox runs and source):
Optional notes:
Related open PRs:
Review informationTest scope: Source and sandbox tests 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, good catch! That was a regression from my append change. Fixed in separate commits:
|
|
This now conflicts with |
|
Thank you for this. What it does is now on This is now on This was checked against |
Getting a comfortable Japanese setup on Omarchy today means following a long blog post: install Mozc, hand-edit fcitx5, fix zoom on JIS keyboards, and so on. This turns that into defaults plus one command, so Japanese users get the same omakase setup everyone else does.
The ThinkPad E595 (JIS) this was tested on. Muhenkan and Henkan sit on either side of the space bar, and Zenkaku/Hankaku is at the top left.
What changes
Automatic, only when the installed layout is Japanese (
XKBLAYOUT=jp):Ctrl + Shift + ;(the+key on JIS) zooms in. Apps seeCtrl + Shift + semicolonand ignore it today, so it's forwarded asCtrl + KP_Add(Ctrl + ^for Obsidian).Ctrl + Space(the tmux/Herdr prefix) switches Mozc back to direct input first, so the key after the prefix reaches the multiplexer instead of Mozc's composition. This only kicks in onceCtrl + Spaceis no longer an fcitx5 toggle key (whichomarchy setup japanesetakes care of), so it never undoes a toggle.omarchy setup japanese(also under Setup > Japanese):fcitx5-mozcandfcitx5-configtooland adds Mozc after the keyboard layout from/etc/vconsole.conf(the same source Hyprland reads). fcitx5's own single-keyboard profile takes that layout; a profile with other input methods keeps them and gets Mozc added after them. One that already has Mozc is left alone.Ctrl + Spacestays free for tmux/Herdr (andHangulgoes too).ja_JP.UTF-8. Typing Japanese doesn't require a Japanese desktop.Deliberately left out
--force-device-scale-factor=1for the Mozc candidate window position in Chromium/Obsidian: it renders those apps at 1x on scaled displays. It's documented as an opt-in workaround in the manual instead.Testing
test/shell.d/setup-japanese-test.shandtest/shell.d/hyprland-jis-bindings-test.sh(runs the JIS bind callbacks against a fakehl). JIS cases were added to the keyboard layout and binding conflict tests.omarchy dev link: Mozc install and profile, Henkan/Muhenkan switching, fcitx5 settings surviving a restart,Ctrl + Spacein tmux/Herdr with Japanese input on,+zoom in Chromium/Obsidian, the interface font, and the locale switch.Each commit is one step, so it should read well commit by commit.
The setup follows @simosako's write-up (https://portablecode.info/2026/08/19/omarchy-quattro-jp-environment-setup/), and the JIS zoom binding is adapted from their gist (https://gist.github.com/simosako/6bec392d00d13abbda00304f5242abe7). Thanks for figuring all of this out!
Omarchy has made Linux a real joy for a lot of us here in Japan. 🇯🇵
Thank you from Tokyo! 🗼 ありがとうございます! 🙏