Search code examples
luaawesome-wm

Lua Arguments in AwesomeWM


I've been at this for a long time now. The AwesomeWM API doesn't document this well enough. I'm just confused as to how I am supposed to put arguments in this:

local cal = awful.widget.calendar_popup.month() 

The documents say that arguments go inside the brackets. I have tried many things but nothing worked. Just how are these arguments supposed to go in the brackets? I have tried doing something like:

    local cal = awful.widget.calendar_popup.month({
           position = "tc",
           bg = "#19191999",
           other values etc etc
    })
cal:attach( mytextclock)

and a variety of other things but nothing worked. What's the correct way?

EDIT: Found out the correct way to do this is this:

local cal = awful.widget.calendar_popup.month({
    style_month = {
       bg_color = "#19191999",
       fg_color = "#ffffff"
    },
})

cal:attach( mytextclock, "tc" )

keep in mind the position of the widget has to remain in the attached widget. Hence "tc".


Solution

  • EDIT: Found out the correct way to do this is this:

    local cal = awful.widget.calendar_popup.month({
        style_month = {
           bg_color = "#19191999",
           fg_color = "#ffffff"
        },
    })
    
    cal:attach( mytextclock, "tc" )
    

    keep in mind the position of the widget has to remain in the attached widget. Hence "tc".