X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/7d431ef9c41f66e885dbace27e0843395940f1bd..5d892e0ceb9d4dece6d2d61b2e5c4046bbc91e9f:/widgets/calendar.lua?ds=inline diff --git a/widgets/calendar.lua b/widgets/calendar.lua index 1728dfc..76faca4 100644 --- a/widgets/calendar.lua +++ b/widgets/calendar.lua @@ -14,7 +14,6 @@ local naughty = require("naughty") local io = { popen = io.popen } local os = { date = os.date } -local mouse = mouse local string = { format = string.format, sub = string.sub, gsub = string.gsub } @@ -47,13 +46,13 @@ function calendar.show(t_out, inc_offset, scr) if offs == 0 or calendar.offset == 0 then -- current month showing, today highlighted calendar.offset = 0 - calendar.notify_icon = calendar.icons .. today .. ".png" + calendar.notify_icon = string.format("%s%s.png", calendar.icons, today) -- bg and fg inverted to highlight today f = io.popen(calendar.cal_format(today)) else -- no current month showing, no day to highlight local month = tonumber(os.date('%m')) - local year = tonumber(os.date('%Y')) + local year = tonumber(os.date('%Y')) month = month + calendar.offset @@ -79,8 +78,8 @@ function calendar.show(t_out, inc_offset, scr) .. "" f:close() - if calendar.followmouse then - scrp = mouse.screen + if calendar.followtag then + scrp = awful.screen.focused() else scrp = scr or calendar.scr_pos end @@ -111,7 +110,7 @@ function calendar.attach(widget, args) calendar.bg = args.bg or beautiful.bg_normal or "#000000" calendar.position = args.position or "top_right" calendar.scr_pos = args.scr_pos or 1 - calendar.followmouse = args.followmouse or false + calendar.followtag = args.followtag or false calendar.offset = 0 calendar.notify_icon = nil