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 = "Actions menu"
-- name_id = "actions"
-- description = "Shows aio launcher actions"
-- type = "drawer"
-- aio_version = "4.7.99"
-- author = "Evgeny Zobnin"
-- version = "1.0"
function on_drawer_open()
actions = aio:actions()
labels = map(actions, function(it) return it.label end)
drawer:show_list(labels)
end
function on_click(idx)
aio:do_action(actions[idx].name)
drawer:close()
end
function map(tbl, f)
local ret = {}
for k,v in pairs(tbl) do
ret[k] = f(v)
end
return ret
end