streetturtle / awesome-wm-widgets

Widgets for Awesome Window Manager
http://pavelmakhov.com/awesome-wm-widgets/
MIT License
2.13k stars 274 forks source link

calendar widget always in top center. Placement has no effect #346

Open richbai90 opened 2 years ago

richbai90 commented 2 years ago

No matter how I set the placement property, the calendar widget is always in the top center

image

My config

local textclock_widget = require("themes.naturedark.textclock")
local text_clock = textclock_widget()

local cw = calendar_widget({
    theme = 'nord',
    start_sunday = true,
    position = 'top right'
    radius = 8,
-- with customized next/previous (see table above)
    previous_month_button = 1,
    next_month_button = 3,
})
text_clock:connect_signal("button::press",
    function(_, _, _, button)
        if button == 1 then cw.toggle() end
    end)

s.mywibox:setup {
        layout = wibox.layout.align.horizontal,
        { -- Left widgets
            layout = wibox.layout.fixed.horizontal,
            --spr,
            s.mytaglist,
            s.mypromptbox
        },
        s.mytasklist, -- Middle widget
        { -- Right widgets
            layout = wibox.layout.fixed.horizontal,
            text_clock,
            wibox.widget.systray(),
            s.mylayoutbox,
        },
    }
akadaedalus commented 2 years ago

Hi. According to the source code you should use top_right with the underscore. That works for me.

My problem is that I want to set it to the top left (where my clock is). The code doesn't do anything for that which seems like an odd decision.

streetturtle commented 2 years ago

Sorry for being late here. @richbai90 - the position option is not recognized, as it has to be with underscore (thank @akadaedalus 👍). @akadaedalus - I can (or you can, by creating a PR 😉) add such option - here is where the "magic" happens.

The reason I didn't add the 'top_left' option is that I simply didin't think about it =) But it totally makes sense. I'll try to add it in the following week.

akadaedalus commented 2 years ago

Oh I suppose I could put a couple of lines in a PR. Hint acknowledged and acted upon.