Set LUA_PATH envvar for fcitx5-lua #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[ARCHIVED]
设置好
LUA_PATH
和LUA_CPATH
后就可以引入模块了$FCITX_DATA_HOME/lua
,为非root用户提供模块放置的位置$XDG_DATA_DIRS/lua/5.4
,和电脑上的lua位置是一样的,为那种反编译再重新打包来集成资源的人提供(放置在assets/usr/share/lua/5.4)/usr/local/share/lua/5.4
,但是对非root用户来说显然没有任何意义当然这是我自己定的,或者你看放置在哪里好一点
下面两例测试通过
例子一:
json_example.lua
,文件内容如下:dkjson.lua
,在此下载dkjson.lua
放置在存储/Android/data/org.fcitx.fcitx5.android/files/data/lua/
,json_example.json
放置在存储/Android/data/org.fcitx.fcitx5.android/files/data/lua/imeapi/extensions/
,重启fcitx5bm
,能够正常输出json。在以前日志会提示找不到模块例子二:
dkjson.lua
,放置在app/src/main/assets/usr/share/lua/5.4/
,并修改那个清单json文件(gradle 构建时会自动生成)json_example.lua
还是放在上述位置,重启配置bm