chore: detect fcitx5 on Linux (#626)

This commit is contained in:
hellodword 2024-01-18 11:46:18 +00:00 committed by GitHub
parent 15e0a57b79
commit 2a2f956cc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,10 @@ local function get_record_filername(record_type)
if system == "Darwin" then
filename = string.format("%s/Library/Rime/lua/cold_word_drop/%s_words.lua", os.getenv('HOME'), record_type)
elseif system == "Linux" then
filename = string.format("%s/.config/ibus/rime/lua/cold_word_drop/%s_words.lua", os.getenv('HOME'), record_type)
filename = string.format("%s/%s/rime/lua/cold_word_drop/%s_words.lua",
os.getenv('HOME'),
(string.find(os.getenv('GTK_IM_MODULE'), 'fcitx') and '.local/share/fcitx5' or '.config/ibus'),
record_type)
end
return filename
end