Added indices

This commit is contained in:
Thomas Forgione 2018-09-16 13:09:47 +02:00
parent 37ecf108e0
commit b67b5c5f43
No known key found for this signature in database
GPG Key ID: 3B8FC64F5BBFE109
1 changed files with 4 additions and 4 deletions

View File

@ -8,12 +8,12 @@ local json = require('jsonutils')
local home = os.getenv('HOME') local home = os.getenv('HOME')
local todo_path = home .. '/.config/todo/todo.json' local todo_path = home .. '/.config/todo/todo.json'
function todo_list_widget(todo, s) function todo_list_widget(index, todo, s)
local text = '\n <b>' .. todo.title .. '</b> \n' local text = '\n <b>' .. index .. '. ' .. todo.title .. '</b> \n'
for key, item in pairs(todo.items) do for key, item in pairs(todo.items) do
text = text .. ' - ' .. item .. ' \n' text = text .. ' ' .. key .. '. ' .. item .. ' \n'
end end
local text = wibox.widget { local text = wibox.widget {
@ -62,7 +62,7 @@ function add_background_widget(s)
local widgets = {} local widgets = {}
for key, val in pairs(todo) do for key, val in pairs(todo) do
l:add(todo_list_widget(val, s)) l:add(todo_list_widget(key, val, s))
end end
background_widget = awful.wibar({ background_widget = awful.wibar({