Skip to content

Commit

Permalink
widget.keyboardlayout: add option for custom keyboard layouts (#3907)
Browse files Browse the repository at this point in the history
Can be used like this:

	awful.widget.keyboardlayout({country_codes = {"raku"}})

Closes #3691
  • Loading branch information
greenfork committed Aug 18, 2024
1 parent 151bb6d commit b9d8305
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/awful/widget/keyboardlayout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,16 @@ end
-- It shows current keyboard layout name in a textbox.
--
-- @constructorfct awful.widget.keyboardlayout
-- @tparam[opt] table args The argument table containing any of the arguments below.
-- @tparam[opt] table args.country_codes Array of names of custom keyboard layouts.
-- @treturn awful.widget.keyboardlayout A keyboard layout widget.
function keyboardlayout.new()
function keyboardlayout.new(args)
if args and args.country_codes then
for _, country_code in ipairs(args.country_codes) do
keyboardlayout.xkeyboard_country_code[country_code] = true
end
end

local widget = textbox()
local self = widget_base.make_widget(widget, nil, {enable_properties=true})

Expand Down

0 comments on commit b9d8305

Please sign in to comment.