Skip to content

Latest commit

 

History

History
371 lines (274 loc) · 14.2 KB

INSTALL.md

File metadata and controls

371 lines (274 loc) · 14.2 KB

Cài đặt ViFastKey trên mọi nền tảng

Ưu tiên Windows và macOS. Linux, Android, iOS, extension, web/WASM và build từ source ở các mục sau.

Trang tải: https://key.vifast.org/#tai-ve Mirror tải trực tiếp khi GitHub Release tạm gián đoạn. Các gói desktop chưa ký Authenticode/Developer ID; SmartScreen/Gatekeeper có thể cảnh báo.

Windows 10/11 — Hook-only (khuyến nghị)

Từ bản này Windows dùng keyboard hook, không cài TSF, không cần ký, không cần Administrator, và không cần cài thêm ngôn ngữ hay chọn English (US) trong Windows.

  1. Tải vifastkey-windows-hook-0.1.3.zip rồi giải nén (Chuột phải → Extract All).
  2. Chạy ViFastKey.exe — một file duy nhất, không cần cài đặt. Hook, tray và tự khởi động cùng Windows được bật ngay; cửa sổ cấu hình mở ra để xem thông tin.
  3. Gõ thử Tieengs Vieejt → Tiếng Việt ở bất kỳ ứng dụng nào.
  4. Đổi Việt ↔ Anh: Alt+, hoặc click biểu tượng ở khay. Mỗi lần đổi có popup giữa màn hình báo trạng thái mới.

Nếu SmartScreen cảnh báo: More info → Run anyway (bản chưa ký).

Trạng thái tray

Icon Ý nghĩa
Logo ViFastKey Đang gõ tiếng Việt
E Đang English (phím đi qua nguyên văn)
Popup giữa màn hình Hiện mỗi khi đổi Việt/Anh
  • Alt+,: đổi Việt ↔ Anh trên mọi layout.
  • Click trái tray: đổi Việt ↔ Anh; double-click mở Settings; chuột phải mở menu.
  • Ctrl+Shift+,: mở Settings.
  • Nút X: ẩn xuống tray. Thoát hẳn: menu tray → Thoát.

Ngôn ngữ Windows và tránh gõ đôi

Hook xử lý trên mọi layout bàn phím — không cần English (US), tiếng Việt hay bất kỳ input source nào.

  • Chỉ dùng ViFastKey: không phải đổi gì trong Windows.
  • Vẫn dùng Microsoft Vietnamese IME: tắt IME đó khi gõ bằng ViFastKey (hoặc Alt+, để chuyển ViFastKey sang English), nếu không sẽ bị gõ đôi.
  • Bàn phím Dvorak/US International: engine lấy ký tự theo layout đang chọn.

Game

  • Thêm game vào Ứng dụng → loại trừ, hoặc chuyển English trước khi chơi.
  • Hook có thể bị anti-cheat chặn; game fullscreen exclusive thường không có IME.
  • Không nên dùng hook trong game có anti-cheat nghiêm ngặt.

Gỡ

  • Thoát: menu khay → Thoát.
  • Tự khởi động: Task Manager → tab Startup → tắt ViFastKey (hoặc xoá giá trị ViFastKey trong HKCU\Software\Microsoft\Windows\CurrentVersion\Run).
  • Xoá cấu hình: %APPDATA%\ViFastKey.

macOS 12+ — IMK

  1. Tải vifastkey-macos-imk-universal.zip và giải nén.
  2. Chạy installer trong thư mục vừa giải nén:
./install.sh

Installer copy ViFastKey.app vào ~/Library/Input Methods/ và đăng ký input source.

  1. Đăng xuất rồi đăng nhập — macOS chỉ làm mới danh sách input source khi session được tạo lại.
  2. System Settings → Keyboard → Text Input → Edit → + → Vietnamese → ViFastKey. macOS sẽ hỏi "Allow ViFastKey to enable ViFastKey?" → bấm Allow (một lần). Đây là hộp thoại bảo mật của macOS cho mọi bộ gõ bên thứ ba.
  3. Gõ thử Tieengs Vieejt → Tiếng Việt.

Kiểm tra trạng thái thật (phải ra enabled=true):

"$HOME/Library/Input Methods/ViFastKey.app/Contents/MacOS/ViFastKeyIM" --status

Nếu Gatekeeper chặn:

xattr -dr com.apple.quarantine "$HOME/Library/Input Methods/ViFastKey.app"

Không cài lại nhiều lần. Bản phát hành chưa ký Developer ID/notarize; mỗi lần build/cài lại, chữ ký ad-hoc đổi nên macOS coi là app mới và hỏi lại quyền. Nếu hộp thoại Allow lặp lại: xoá input source, chạy lại installer một lần, rồi đăng xuất/đăng nhập.

Adapter dùng IMK preedit, menu Telex/Simple Telex/VNI, macro và app profile.

Linux — chọn một adapter

Chỉ cài MỘT trong ba: IBus, Fcitx5 hoặc Wayland. Cài nhiều hơn sẽ tranh nhau xử lý phím, gõ đôi hoặc mất chữ.

  • GNOME / IBus → cài gói IBus.
  • KDE / Fcitx5 → cài gói Fcitx5.
  • Sway / Hyprland / niri (hỗ trợ zwp_input_method_v2) → cài Wayland standalone.

Chỉ chọn một dòng theo môi trường đang dùng; không cài cả ba.

Linux — cài bằng một lệnh (khuyến nghị)

Không muốn tự giải nén/gõ từng bước? Script cài chính thức tự chọn đúng gói, đối chiếu SHA256 với sha256sums.txt của bản phát hành rồi mới cài:

curl -fsSLo /tmp/vfk.sh https://key.vifast.org/install.sh
less /tmp/vfk.sh        # xem qua trước khi chạy
bash /tmp/vfk.sh        # tự nhận IBus / Fcitx5 / Wayland
  • Cài vào $HOME cho user hiện tại, không cần root; chỉ IBus/Fcitx5 mới hỏi sudo một lần (IBus ghi component vào /usr/share/ibus/component, Fcitx5 chép addon vào /usr).
  • Cài xong script in đúng các bước cuối: đăng xuất/đăng nhập, thêm input source.
  • Đừng dùng curl … | sh cho IBus/Fcitx5: khi pipe, stdin là chính script nên sudo không nhập được mật khẩu. Script sẽ dừng và in lệnh cần chạy thay vì cài nửa chừng.
# Chọn tay adapter khi script nhận nhầm desktop
bash /tmp/vfk.sh --adapter=ibus       # GNOME/IBus
bash /tmp/vfk.sh --adapter=fcitx5     # KDE/Fcitx5
bash /tmp/vfk.sh --adapter=wayland    # Sway/Hyprland/niri
bash /tmp/vfk.sh --adapter=settings   # chỉ UI cấu hình (không phải bộ gõ)

# Xem trước, ghim bản, hoặc gỡ
bash /tmp/vfk.sh --dry-run
bash /tmp/vfk.sh --version=0.1.3
bash /tmp/vfk.sh --uninstall --adapter=ibus

Arch Linux / Manjaro

Script nhận diện distro qua /etc/os-release và đổi lệnh gói theo trình quản lý gói của máy (pacman, apt, dnf, zypper). Thêm --deps để nó tự cài gói phụ thuộc, khỏi phải tra tên gói của Arch:

curl -fsSLo /tmp/vfk.sh https://key.vifast.org/install.sh
bash /tmp/vfk.sh --adapter=ibus --deps     # Arch/GNOME: ibus python-pip python-gobject
bash /tmp/vfk.sh --adapter=fcitx5 --deps   # Arch/KDE Plasma: fcitx5 fcitx5-gtk fcitx5-qt

Gói hệ thống tương ứng từng distro (dùng khi cài tay):

Adapter Arch (pacman) Ubuntu/Debian (apt) Fedora (dnf)
IBus ibus python-pip python-gobject ibus ibus-gtk3 ibus-gtk4 python3-gi gir1.2-ibus-1.0 python3-pip ibus python3-gobject python3-pip
Fcitx5 fcitx5 fcitx5-gtk fcitx5-qt fcitx5 fcitx5-frontend-gtk3 fcitx5-frontend-gtk4 fcitx5-frontend-qt5 fcitx5 fcitx5-gtk fcitx5-qt
Wayland libxkbcommon libxkbcommon0 libxkbcommon
Settings UI libxkbcommon libglvnd wayland libx11 libxkbcommon0 libgl1 libwayland-client0 libx11-6 libxkbcommon mesa-libGL libwayland-client libX11

Settings UI (--adapter=settings) là ứng dụng egui tự chứa: binary chỉ link libc/libm/libgcc, các thư viện cửa sổ (X11/Wayland/GL) được nạp lúc chạy.

Không có gói chính thức trong AUR/repo Arch: install.sh cài vào $HOME và chỉ dùng sudo một lần cho component XML/addon; gỡ bằng --uninstall --adapter=….

Yêu cầu: bash, curl (hoặc wget), tar; gói x86_64 — riêng IBus chạy được mọi kiến trúc vì engine là Python. Cài tay vẫn được: xem từng adapter bên dưới.

Linux — Wayland standalone (Sway / Hyprland / niri)

Adapter này không cần Fcitx5/IBus; nó dùng zwp_input_method_v2 + zwp_virtual_keyboard_v1. Đã test trên Sway; compositor khác (Hyprland/niri) phải kiểm tra --probe trước. GNOME/KDE dùng Fcitx5 hoặc IBus bên dưới.

Cài từ gói phát hành:

mkdir -p vifastkey-wayland
tar -xzf vifastkey-wayland-linux-x86_64.tar.gz -C vifastkey-wayland
cd vifastkey-wayland && ./install.sh
systemctl --user enable --now vifastkey-wayland.service

Hoặc build từ source:

# Ubuntu/Debian
sudo apt install libxkbcommon-dev

cd rust
cargo build --release -p vifastkey-wayland
./target/release/vifastkey-wayland --probe
./target/release/vifastkey-wayland --debug   # chạy thử

Nếu --probe báo thiếu zwp_input_method_manager_v2, compositor không hỗ trợ.

Cài vào ~/.local + systemd user service:

./linux/wayland/install.sh
systemctl --user enable --now vifastkey-wayland.service
journalctl --user -u vifastkey-wayland -f

Cấu hình dùng chung ~/.config/vifastkey/config.json. Test E2E:

sudo apt install sway wtype python3-gi gir1.2-gtk-4.0
./linux/wayland/runtime_test.sh

Giới hạn: chưa có app_id (không áp AppProfile theo app), không popup candidate; app XWayland/legacy không dùng text-input-v3 có thể không nhận preedit.

Linux — IBus

mkdir -p vifastkey-ibus
tar -xzf vifastkey-ibus-linux.tar.gz -C vifastkey-ibus
cd vifastkey-ibus && ./install.sh   # hỏi sudo một lần để ghi component XML vào /usr

Sau đó:

  1. Logout/login để GNOME/IBus nhận engine mới và environment.
  2. Settings → Keyboard → Input Sources → + → Vietnamese → ViFastKey.
  3. Nếu terminal/GTK app vẫn dùng fcitx cũ, kiểm tra:
echo "$GTK_IM_MODULE $QT_IM_MODULE $XMODIFIERS"
ibus restart

Cần ibus, python3-gi, gir1.2-ibus-1.0 (Ubuntu/Debian). Chi tiết: linux/ibus/README.md.

Linux — Fcitx5

# Gói dùng prefix /usr nên cần sudo; không có install.sh riêng.
sudo tar -xzf vifastkey-fcitx5-linux-x86_64.tar.gz -C /
fcitx5 -r

Addon được build trên Ubuntu nên file .so nằm ở đường dẫn multiarch của Debian (/usr/lib/x86_64-linux-gnu/fcitx5/). Arch tìm addon ở /usr/lib/fcitx5/, Fedora ở /usr/lib64/fcitx5/ — không chuyển thì addon cài xong mà fcitx5 không nạp:

# Arch/Manjaro
sudo install -Dm755 /usr/lib/x86_64-linux-gnu/fcitx5/libvifastkey.so \
  /usr/lib/fcitx5/libvifastkey.so
sudo rm -f /usr/lib/x86_64-linux-gnu/fcitx5/libvifastkey.so
fcitx5 -r

install.sh --adapter=fcitx5 --deps tự làm bước này theo distro.

Thêm ViFastKey trong Fcitx5 Configuration → Input Method; logout/login nếu cần. Cần fcitx5, fcitx5-frontend-gtk3/gtk4, fcitx5-frontend-qt5/6. Chi tiết: linux/fcitx5/README.md.

UEFI x86_64 — bản demo đầu tiên

Ứng dụng UEFI tự chứa, chạy trước khi OS boot: editor Telex/VNI, GOP + font tiếng Việt nhúng. Không phải IME toàn hệ thống; không gõ được vào UEFI Setup, UEFI Shell hay app UEFI khác.

  1. Tải vifastkey-uefi-x86_64.zip.
  2. Giải nén vào gốc USB FAT32, giữ EFI/BOOT; kết quả đúng là \EFI\BOOT\BOOTX64.EFI.
  3. Tắt Secure Boot (hoặc ký file), bật USB boot, tắt Fast Boot/CSM nếu cần.
  4. Boot từ USB; gõ Tieengs Vieejt → Tiếng Việt.
  5. F1 trợ giúp + QR trang chủ (F1 lần nữa hoặc Esc để đóng), F2 Việt/Anh, F3 Telex/VNI, F10 thoát; Backspace xoá phím thô cuối, Enter xuống dòng, mũi tên/Home/End di chuyển. Header có logo và URL key.vifast.org.

Yêu cầu: x86_64 UEFI (không hỗ trợ IA32), USB FAT32, bàn phím layout US, Secure Boot tắt hoặc tự ký. Giới hạn: chưa có macro, gợi ý từ, charset legacy, file cấu hình; chưa test rộng trên firmware thật.

Xử lý sự cố: USB không hiện → kiểm tra FAT32/đường dẫn, tắt Fast Boot/CSM; Secure Boot violation → tắt hoặc ký; màn hình đen → firmware không có GOP; F10 về boot menu là đúng thiết kế.

Build/test/package:

cd uefi
./tools/build.sh
./tools/test.sh
./package.sh

Android

Tải vifastkey-android-debug.apk, bật Install unknown apps, cài rồi mở. Trong Android Settings → System → Languages & input → On-screen keyboard → ViFastKey → bật. Đây là IME Android đầy đủ; bản debug chưa ký Play Store.

iOS

vifastkey-ios-simulator.zip chỉ chạy trên iOS Simulator (chưa ký Apple Developer). Cài Xcode, mở Simulator, kéo app vào; hoặc build từ ios/. Thiết bị thật cần ký Apple Developer + provision profile.

Chrome/Edge extension

# tải vifastkey-chrome-extension.zip rồi giải nén
# chrome://extensions → Developer mode → Load unpacked → chọn thư mục

Extension dùng WASM; không cần server. Chi tiết: chrome-extension/README.md.

Web/WASM

  • Bản online: https://key.vifast.org/
  • Playground chạy WASM local trong browser.
  • API Python: /api/type, /api/charset; xem deploy/vifastkey_web/README.md.
  • Gói vifastkey-wasm.zip để nhúng hoặc phục vụ static.

Build từ source

# Python oracle
cd python
pip install -e ".[dev]"
python -m pytest -q

# Rust engine + desktop UI
cd ../rust
cargo build --workspace
cargo test --workspace
cargo run -p vifastkey-settings

# Windows hook-only package
cargo build --release -p vifastkey-settings
powershell -ExecutionPolicy Bypass -File ..\packaging\package-windows.ps1

# Linux settings
cargo build --release -p vifastkey-settings
VIFASTKEY_SETTINGS_BIN=target/release/vifastkey-settings \
  ../packaging/package-linux.sh

# macOS IMK
cd ..
./macos/build.sh
./macos/package.sh

Windows cần Rust MSVC + Windows SDK; Linux cần X11/Wayland dev libs; macOS cần Xcode. TSF cũ nằm trong windows/tsf/ chỉ để tham khảo/legacy, không được đóng gói mặc định.

Kênh phân phối

Kênh Trạng thái
Website /downloads/0.1.3/ Mirror chính khi GitHub tạm khoá
GitHub Release Có asset UEFI vifastkey-uefi-x86_64.zip cùng các nền tảng khác
UEFI demo vifastkey-uefi-x86_64.zip, chạy trước OS; chưa ký Secure Boot
Winget/Scoop/Homebrew Chưa có; cần installer/ký
Chrome Web Store / Play Store / App Store Chưa phát hành

Giấy phép

Mã nguồn MIT hoặc Apache-2.0. Xem LICENSE-MIT, LICENSE-APACHE và THIRD_PARTY_NOTICES.md.