This is a little bit hacky workaround taken from this issue on the Awesome WM github bug tracker:
Create a function keyboardlayout_with_font(font)
in your rc.lua
:
function keyboardlayout_with_font(font)
local result = awful.widget.keyboardlayout()
result.widget.font = font
return result
end
Then you can use this function in your code e.g.:
mykeyboardlayout = wibox.widget {
{
{
widget = keyboardlayout_with_font("Noto Sans Bold 10")
},
fg = "white", -- text color
-- bg = "blue",
widget = wibox.container.background
},
bottom = 3,
color = "red",
widget = wibox.container.margin
}
Btw. your code is not runnable you are missing a - in the comment --text-color