Added ibus hook for host interface

master
Mark 2022-08-03 18:04:09 -07:00
parent c9aef48da2
commit 17725f8807
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 18 additions and 0 deletions

View File

@ -1,9 +1,27 @@
local util = require("modules.ibus.util")
local popup = require("modules.ibus.popup")
local widget = require("modules.ibus.widget")
return {
widget = require("modules.ibus.widget").widget,
keybinds = require("modules.ibus.keybinds"),
set = function(lang)
-- Switch to a language. Used by host interface.
local lang_id
for k, v in pairs(config.ibus.language_list) do
if (v["indicator_code"] == lang) then
lang_id = k
end
end
util.set(lang_id, function()
popup.update()
widget.update()
end)
end,
init = function()
util.set(1)
end