你可以让 fcitx5 对 zenity 默认激活。在 ~/.local/share/fcitx5/lua/imeapi/extensions 创建一个 .lua 文件,写上:
local fcitx = require("fcitx")
local app_im = {
['zenity'] = '你想要用的输入法',
}
function onContextCreated()
local p = fcitx.currentProgram()
local colon = p:find(':', 1, true)
if colon then
p = p:sub(1, colon-1)
end
local a = app_im[p]
if a then
fcitx.setCurrentInputMethod(a, true)
end
end
fcitx.watchEvent(fcitx.EventType.ContextCreated, "onContextCreated")