Add new drawer scripts

This commit is contained in:
Evgeny
2023-07-14 21:18:05 +04:00
parent 082df0cd09
commit 92f6e0de16
22 changed files with 520 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
-- name = "Drawer sample #4"
-- type = "drawer"
-- testing = "true"
function on_drawer_open()
pkgs = apps:list()
apps:request_icons(pkgs)
end
function on_icons_ready(icons)
names = map(pkgs, function(it) return apps:name(it) end)
drawer:show_list(names, icons, nil, true)
end
function on_click(idx)
apps:launch(pkgs[idx])
end
function map(tbl, f)
local ret = {}
for k,v in pairs(tbl) do
ret[k] = f(v)
end
return ret
end