X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/d836fcd6255b34dc19713d9e7b0b737fee738b59..2c1eb09080947d4f587e001497f12c6084babffa:/widgets/contrib/kbdlayout.lua?ds=inline diff --git a/widgets/contrib/kbdlayout.lua b/widgets/contrib/kbdlayout.lua index da3084c..08e7bd0 100644 --- a/widgets/contrib/kbdlayout.lua +++ b/widgets/contrib/kbdlayout.lua @@ -16,7 +16,7 @@ local setmetatable = setmetatable -- Keyboard layout switcher -- lain.widgets.contrib.kblayout -local kbdlayout = helpers.make_widget_textbox() +local kbdlayout = {} local function worker(args) local args = args or {} @@ -28,6 +28,8 @@ local function worker(args) if args.add_us_secondary == false then add_us_secondary = false end + kbdlayout.widget = wibox.widget.textbox() + local function kbd_run_settings(layout, variant) kbdlayout_now = { layout = string.match(layout, "[^,]+"), -- Make sure to match the primary layout only. @@ -72,7 +74,7 @@ local function worker(args) helpers.newtimer("kbdlayout", timeout, kbdlayout.update) - return setmetatable(kbdlayout, { __index = kbdlayout.widget }) + return kbdlayout end return setmetatable({}, { __call = function (_, ...) return worker(...) end })