Skip to content

docs(linux): lead with Fcitx5, and get the session variables right - #7

Merged
pcodedynamics merged 1 commit into
mainfrom
docs/linux-install-fcitx5-default
Sep 6, 2026
Merged

docs(linux): lead with Fcitx5, and get the session variables right#7
pcodedynamics merged 1 commit into
mainfrom
docs/linux-install-fcitx5-default

Conversation

@pcodedynamics

@pcodedynamics pcodedynamics commented Sep 6, 2026

Copy link
Copy Markdown
Member

Vấn đề

install.sh giờ cài Fcitx5 trên mọi desktop (Funput/Funput#341), nhưng trang cài đặt Linux vẫn đặt IBus lên trước ở mọi bảng và mọi khối lệnh.

Rà lại trang thì phần biến môi trường mới là chỗ yếu nhất, và nó vừa trở thành bước bắt buộc của đường mặc định. Trang chỉ đưa bộ ba của X11 — bộ đó đúng cho X11, nhưng trang không hề nói phiên Wayland cần thứ khác, mà đó lại là phiên phần lớn người đọc đang dùng: ở Wayland, GTK 3/4 tự đi text-input-v3, còn đặt cả bộ ở mức global làm nhấp nháy candidate window trên KWin. Trang cũng không có mục Wayland nào.

Cùng lượt rà tìm ra vài chỗ khác sai hoặc thiếu.

Thay đổi

Fcitx5 lên trước

funput (Fcitx5) dẫn đầu mọi bảng và khối lệnh; funput-ibus vẫn được ghi đầy đủ ngay bên dưới cho ai đang dùng IBus và không muốn đổi session. Có thêm cảnh báo: trên GNOME/Ubuntu, chọn Fcitx5 nghĩa là phải nối session rồi đăng xuất — cài xong chưa gõ được ngay.

Mục biến môi trường viết lại theo upstream

Nguồn: Using Fcitx 5 on Wayland (sửa 20/09/2025) và Setup Fcitx 5.

Mục mới phân nhánh theo loại session trước, desktop sau — đúng thứ tự upstream dùng:

Session Desktop Đặt gì
x11 mọi desktop XMODIFIERS + GTK_IM_MODULE + QT_IM_MODULE
wayland GNOME, sway, wlroots XMODIFIERS + QT_IM_MODULE; để trống GTK_IM_MODULE. Qt 6.8.2+ dùng QT_IM_MODULES=wayland;fcitx
wayland KDE Plasma 5.27+ chỉ XMODIFIERS

Kèm bảng công cụ theo distro, vì đây là thứ trang hoàn toàn bỏ qua:

Distro Công cụ
Debian / Ubuntu im-config -n fcitx5
Fedora gói fcitx5-autostart, hoặc im-chooser
Arch, openSUSE không có — đặt tay

Và một cảnh báo kiểm chứng trực tiếp trên Ubuntu 26.04: im-config không đặt biến nào trong phiên Wayland/etc/X11/Xsession.d/70im-config_launch bỏ qua khi XDG_SESSION_TYPE=wayland, còn /etc/profile.d/im-config_wayland.sh được ship ở dạng comment toàn bộ (if false && …). Nên im-config -n fcitx5 chỉ có tác dụng cho X11.

Thêm bảng nơi đặt biến, vì environment.d không phổ quát như trang cũ ngụ ý — upstream nói nó chỉ được GDM và Plasma 5.22+ đọc, nên ~/.bash_profile (mọi DM + đăng nhập TTY) và /etc/profile được nêu làm phương án. Upstream cũng khuyên khởi động lại máy chứ không chỉ đăng xuất, vì systemd user manager có thể sống sót qua logout.

Các lỗi khác đã sửa

Chỗ Vấn đề
Khối SHA-256 Trang hứa mỗi release kèm file .sha256 và đưa lệnh sha256sum -c. Không release Linux nào từng có file đó (release.yml không sinh, không đính kèm). Đã bỏ; installer giờ tự verify digest từ release API.
fcitx5 -r -d Sai trên KDE: KWin trao daemon một socket mà tiến trình mới không kế thừa được, restart làm app Wayland mất bộ gõ tới lần đăng nhập sau. Cả hai chỗ khuyên restart giờ đều nói rõ.
--user Nằm dưới mục Arch dù chạy trên mọi distro, và không nhắc Fcitx5 cần đăng xuất lại. Giờ là mục riêng.
Xử lý sự cố Không có nhánh Fcitx5. Thêm fcitx5-diagnose, và một mục cho trường hợp đã thêm Funput nhưng gõ không ăn.
Cảnh báo hai gói Nói "không cài cả hai", trái với packaging (không có Conflicts, hai gói tách file, cùng phụ thuộc funput-settings đúng version) và trái với release notes. Sửa thành: cài chung được, mỗi session chỉ bật một.
openSUSE Cài .rpm rời sẽ vướng chữ ký — thêm --allow-unsigned-rpm và ghi chú vì sao.
funput-settings Chỉ được nhắc ở mục Arch, dù mọi distro đều kéo theo.

Cả hai locale vien.

Kiểm thử

  • Script soát anchor: mọi liên kết ](#…) trong cả hai file đều khớp một id có thật ({#bat-bo-go}, {#noi-session}, {#khong-sudo}, {#dat-o-dau}); không dòng nào có ký tự < kiểu JSX ngoài code block.
  • Hai file cùng số dòng (446) — bản dịch không lệch mục nào.
  • Các khẳng định về Debian/Ubuntu kiểm trực tiếp trên Ubuntu 26.04: im-config -libus fcitx5 xim; nội dung /usr/share/im-config/data/23_fcitx5.rc; hai hook nói trên; env của session cho thấy Ubuntu đã dùng QT_IM_MODULES.
  • Tên gói và định dạng file đối chiếu với CPACK_* trong fcitx5/CMakeLists.txt, ibus/CMakeLists.txt; tên tarball --user đối chiếu build-linux.yml.
  • pnpm build chưa chạy — máy dựng không có node/pnpm. Cần chạy trước khi merge để bắt lỗi liên kết mà script soát của tôi không thấy.
  • Phần Fedora (fcitx5-autostart, im-chooser) lấy nguyên từ wiki upstream, chưa kiểm trên máy Fedora thật.

🤖 Generated with Claude Code

install.sh now installs Fcitx5 on every desktop, so `funput` leads every table
and command block, with `funput-ibus` documented in full right below it for
anyone already on IBus who would rather not rewire their session.

The environment-variable section was the weak part and is now rebuilt against
upstream (Using_Fcitx_5_on_Wayland, Setup_Fcitx_5). It gave only the X11 trio —
correct for X11, but the page never said a Wayland session needs something
different, and that is the session most readers are in: GTK 3/4 speak
text-input-v3 on their own there, and the trio set globally makes KWin blink the
candidate window. The section now branches on `$XDG_SESSION_TYPE` first and the
desktop second, names the tool that owns this per distro (`im-config` on
Debian/Ubuntu, `fcitx5-autostart` on Fedora, by hand on Arch and openSUSE),
warns that im-config sets nothing in a Wayland session because that hook ships
disabled, carries the Qt 6.8.2+ `QT_IM_MODULES` form, and lists where the
variables can live — environment.d is read by GDM and Plasma 5.22+ only, so
~/.bash_profile is offered for everyone else, with the reboot upstream asks for.

Two more corrections from the same pass. `fcitx5 -r` is wrong on KDE, where KWin
hands the daemon a socket a replacement cannot inherit, so both places that
suggested restarting now say to log out instead. And the page promised a .sha256
file with every release and a `sha256sum -c` line for it, but no Linux release
has ever carried one — the installer verifies the release API's digest itself.

Also: --user sat under Arch despite working on every distro and said nothing
about the re-login Fcitx5 needs; Troubleshooting had no Fcitx5 branch; and the
warning against installing both packages contradicted the packaging, which lets
them coexist — enabling both in one session is the actual problem.

Both locales.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pcodedynamics pcodedynamics self-assigned this Sep 6, 2026
@pcodedynamics pcodedynamics added the documentation Improvements or additions to documentation label Sep 6, 2026
@pcodedynamics
pcodedynamics merged commit 3d2fc71 into main Sep 6, 2026
@pcodedynamics
pcodedynamics deleted the docs/linux-install-fcitx5-default branch September 6, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant