fcitx / fcitx5-rime

223 stars 22 forks source link

请问 fcitx5-rime 有没有一键重新部署的命令 #28

Closed hxse closed 3 years ago

hxse commented 3 years ago

我知道有图形按钮,但是想要一个命令行的,用来写脚本

ssfdust commented 3 years ago

在librime中有个https://github.com/rime/librime/blob/master/tools/rime_deployer.cc 在Archlinux中,位于/usr/bin/rime_deployer,假如没有的话,可以自己编译一个 直接运行可以看到帮助

Usage:
    --add-schema <schema_id>...
        Add one or more schema_id(s) to the schema_list, write patch in default.custom.yaml

    --build [user_data_dir] [shared_data_dir] [staging_dir]
        Build and deploy Rime data.
        If unspecified, user_data_dir and shared_data_dir defaults to the working directory.
        To deploy data for ibus-rime, use the following directories:
        user_data_dir    ~/.config/ibus/rime
        shared_data_dir  /usr/share/rime-data
        staging_dir      ~/.config/ibus/rime/build

    --compile <x.schema.yaml> [user_data_dir] [shared_data_dir] [staging_dir]
        Compile a specific schema's dictionary files.

    --set-active-schema <schema_id>
        Set the active schema in user.yaml

部署就是--build参数,后面接user_data_dir,fcitx5默认好像是~/.local/share/fcitx5/rime(Arch是这样),所以staging_dir是~/.local/share/fcitx5/rime/build,shared_data_dir这个是存放rime默认的schema等等的数据,比如luna_pinyin.dict.yamlluna_pinyin_simp.schema.yaml等等,patch就是针对这些数据的。Archlinux是放在/usr/share/rime-data,可能其他发行版也在这,我不清楚。

所以部署指令就是:

rime_deployer --build ~/.local/share/fcitx5/rime/ /usr/share/rime-data ~/.local/share/fcitx5/rime/build

此外实现同步的是rime_dict_manager,这个源码在这边,https://github.com/rime/librime/blob/master/tools/rime_dict_manager.cc

这个算Question,而且不属于fcitx5范畴内,无论从哪方面都不应该出现在github上,可以去tg群或者论坛,问这些东西。

wengxt commented 3 years ago

Use this command: qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SetConfig "fcitx://config/addon/rime/deploy" ""

You can use dbus-send or busctl as a replacement, they can also send request via dbus, but argument might be a little bit different.

nkta3m commented 2 years ago

这个是重新部署,如果要同步数据应该怎么写命令?

tankb52 commented 5 months ago

这个是重新部署,如果要同步数据应该怎么写命令?

qdbus org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.SetConfig "fcitx://config/addon/rime/sync" ""

在这里看到的。 https://www.expoli.tech/articles/2024/04/20/Arch-Linux-Fcitx5-rime-quick-command