mirror of
https://github.com/qingjian-team/qingjian.git
synced 2026-11-06 16:13:55 +00:00
GNOME 默认的输入法框架是 IBus:加一个 IBus 前端(纯 Rust,与 Fcitx5 插件共用同一个 Server),安装脚本按机器上有哪个框架装对应的前端(--frontend auto/fcitx5/ibus/both),可选把 Server 装成随登录启动的 systemd 用户服务。 协议类型搬进 qingjian_platform::protocol::linux,两个前端共用。GNOME Wayland 上组句中按应用快捷键时先把拼音上屏到原来的框。 合并 main 时保留 #351 的 --fcitx4(单独一支,不与 --frontend 同用)。
29 lines
1.7 KiB
Bash
Executable File
29 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
# //! 预编译包的安装脚本(package.sh 放到包根目录的 install.sh):解开产品数据,装到用户目录;Server 由用户手动启动。
|
||
set -euo pipefail
|
||
here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||
install_prefix="$HOME/.local"
|
||
while (($#)); do
|
||
case "$1" in
|
||
--prefix) install_prefix=${2:?--prefix 需要路径}; shift 2 ;;
|
||
--help) echo '用法:install.sh [--prefix 绝对用户目录]'; exit 0 ;;
|
||
*) echo "未知参数:$1" >&2; exit 2 ;;
|
||
esac
|
||
done
|
||
[[ "$install_prefix" = /* && "$install_prefix" != / ]] || { echo '需要非根绝对安装路径' >&2; exit 2; }
|
||
missing=()
|
||
for tool in python3 fcitx5; do
|
||
command -v "$tool" >/dev/null 2>&1 || missing+=("$tool")
|
||
done
|
||
if ((${#missing[@]})); then
|
||
echo "缺少依赖:${missing[*]}" >&2
|
||
echo 'Debian / Ubuntu:sudo apt install python3 fcitx5 fcitx5-frontend-gtk3 fcitx5-frontend-gtk4 fcitx5-frontend-qt6 fcitx5-config-qt' >&2
|
||
exit 1
|
||
fi
|
||
install_prefix=$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$install_prefix")
|
||
mkdir -p "$here/data"
|
||
# 数据包在 macOS 上打,带 LIBARCHIVE.xattr 扩展头,GNU tar 会逐个警告
|
||
tar --warning=no-unknown-keyword -xzf "$here/target/release-data/qingjian-data.tar.gz" -C "$here"
|
||
python3 "$here/files.py" install "$install_prefix" --root "$here" --server "$here/bin/qingjian-linux-server" --settings "$here/bin/qingjian-settings" --plugin "$here/lib/qingjian.so"
|
||
printf '已安装。手动启动:%s/bin/qingjian-linux-server\n重启 Fcitx5,在配置工具取消“仅显示当前语言”后添加“青简”。\n设置:应用菜单里的“青简设置”,或 %s/bin/qingjian-settings\n' "$install_prefix" "$install_prefix"
|