X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/1ece7c35b7b119ebb1c1bef33d5c04507ff2f117..e2fb62f0f5a89db5c628742162cb14f32e603e78:/widget/calendar.lua?ds=sidebyside diff --git a/widget/calendar.lua b/widget/calendar.lua index 99e8817..84b025d 100644 --- a/widget/calendar.lua +++ b/widget/calendar.lua @@ -1,9 +1,8 @@ - --[[ - - Licensed under GNU General Public License v2 - * (c) 2013, Luke Bonham - + + Licensed under GNU General Public License v2 + * (c) 2013, Luca CPZ + --]] local helpers = require("lain.helpers") @@ -38,8 +37,8 @@ function calendar.show(t_out, inc_offset, scr) if current_month then -- today highlighted calendar.offset = 0 - calendar.icon = string.format("%s%s.png", calendar.icons, tonumber(os.date("%d"))) - f = calendar.cal + calendar.icon = calendar.icons:len() > 0 and string.format("%s%s.png", calendar.icons, tonumber(os.date("%d"))) + f = calendar.cal else -- no current month showing, no day to highlight local month = tonumber(os.date("%m")) local year = tonumber(os.date("%Y")) @@ -63,7 +62,7 @@ function calendar.show(t_out, inc_offset, scr) helpers.async(f, function(ws) local fg, bg = calendar.notification_preset.fg, calendar.notification_preset.bg calendar.notification_preset.text = ws:gsub("%c%[%d+[m]?%s?%d+%c%[%d+[m]?", - markup.bold(markup.color(bg, fg, os.date("%e")))):gsub("\n*$", "") + markup.bold(markup.color(bg, fg, os.date("%e")))):gsub("[\n%s]*$", "") local widget_focused = true