From 95b91a57f7816bd8f1f3bfe1c7e0d4ea9e3215f1 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 14 Sep 2018 15:06:13 +0200 Subject: [PATCH] Background widget now working --- awesome/background_widget.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/awesome/background_widget.lua b/awesome/background_widget.lua index a6e6429..3977df4 100644 --- a/awesome/background_widget.lua +++ b/awesome/background_widget.lua @@ -15,10 +15,10 @@ end function todo_list_widget(todo, s) - local text = '\n ' .. todo.title .. '\n' + local text = '\n ' .. todo.title .. ' \n' for key, item in pairs(todo.items) do - text = text .. ' - ' .. item .. '\n' + text = text .. ' - ' .. item .. ' \n' end local text = wibox.widget { @@ -35,8 +35,6 @@ function todo_list_widget(todo, s) widget.shape_border_width = 1 widget.shape_border_color = "#ffffff" - widget.forced_width = todo.width - widget.forced_height = todo.height widget.point = { x = todo.x, y = todo.y } return widget @@ -54,10 +52,17 @@ function add_background_widget(s) todo = json.parse(content) + local margin = 25 + local l = wibox.layout { - layout = wibox.layout.manual + homogeneous = true, + spacing = margin, + forced_num_cols = 3, + layout = wibox.layout.grid, } + l:set_orientation('horizontal') + local widgets = {} for key, val in pairs(todo) do @@ -71,7 +76,7 @@ function add_background_widget(s) }) background_widget:setup { - l, + wibox.container.margin(l, margin, margin, margin, margin), layout = wibox.layout.manual }