X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/eb8cec907a50f3fd6df4b14ae10b910444017f92..b8e6f4c4b629250dbf074fda3e4dc116c5db3d5b:/widgets/calendar.lua diff --git a/widgets/calendar.lua b/widgets/calendar.lua index e28e735..f684fd7 100644 --- a/widgets/calendar.lua +++ b/widgets/calendar.lua @@ -21,12 +21,12 @@ local setmetatable = setmetatable -- Calendar notification -- lain.widgets.calendar local calendar = {} -local notification = nil +local cal_notification = nil function calendar:hide() - if notification ~= nil then - naughty.destroy(notification) - notification = nil + if cal_notification ~= nil then + naughty.destroy(cal_notification) + cal_notification = nil end end @@ -86,7 +86,6 @@ function calendar:show(t_out, inc_offset) f = io.popen('/usr/bin/cal ' .. month .. ' ' .. year) end - c_text = "" .. f:read() .. "\n\n" @@ -95,18 +94,18 @@ function calendar:show(t_out, inc_offset) .. "" f:close() - notification = naughty.notify({ text = c_text, - icon = calendar.notify_icon, - position = calendar.position, - fg = calendar.fg, - bg = calendar.bg, - timeout = tims }) + cal_notification = naughty.notify({ text = c_text, + icon = calendar.notify_icon, + position = calendar.position, + fg = calendar.fg, + bg = calendar.bg, + timeout = tims }) end function calendar:attach(widget, args) local args = args or {} calendar.icons = args.icons or icons_dir .. "cal/white/" - calendar.font_size = tonumber(args.font_size) or 12 + calendar.font_size = tonumber(args.font_size) or 11 calendar.fg = args.fg or beautiful.fg_normal or "#FFFFFF" calendar.bg = args.bg or beautiful.bg_normal or "#FFFFFF" calendar.position = args.position or "top_right"