From bb4ba9dc907433a940180045e8ab43f39eb06a71 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sun, 1 Nov 2020 20:40:59 -0500 Subject: [github-contributions] quickfix of #203 --- github-contributions-widget/github-contributions-widget.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'github-contributions-widget') diff --git a/github-contributions-widget/github-contributions-widget.lua b/github-contributions-widget/github-contributions-widget.lua index 3025d17..7da2b48 100644 --- a/github-contributions-widget/github-contributions-widget.lua +++ b/github-contributions-widget/github-contributions-widget.lua @@ -24,6 +24,14 @@ local github_contributions_widget = wibox.widget{ widget = wibox.container.mirror } +local color_dict = { + color_calendar_graph_day_L4_bg = '#216e39', + color_calendar_graph_day_L3_bg = '#239a3b', + color_calendar_graph_day_L2_bg = '#7bc96f', + color_calendar_graph_day_L1_bg = '#c6e48b', + color_calendar_graph_day_bg = '#ebedf0', +} + local function worker(args) local args = args or {} @@ -62,7 +70,7 @@ local function worker(args) local col = {layout = wibox.layout.fixed.vertical} local row = {layout = wibox.layout.fixed.horizontal} - local a = 5 - os.date('%w') + local a = 6 - os.date('%w') for i = 0, a do table.insert(col, get_square('#ebedf0')) end @@ -73,7 +81,7 @@ local function worker(args) table.insert(row, col) col = {layout = wibox.layout.fixed.vertical} end - table.insert(col, get_square(colors)) + table.insert(col, get_square(color_dict[colors:match('var%(%-%-(.*)%)'):gsub('-', '_')])) a = a + 1 end github_contributions_widget:setup( -- cgit v1.2.3