Move dev widgets to the dedicated folder
This commit is contained in:
23
dev/aioactionslist-widget.lua
Normal file
23
dev/aioactionslist-widget.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-- name = "AΙΟ actions list"
|
||||
-- type = "widget"
|
||||
-- description = "Shows actions returned by aio:actions() function"
|
||||
--foldable = "true"
|
||||
-- author = "Theodor Galanis"
|
||||
-- version = "1"
|
||||
|
||||
function on_resume()
|
||||
actions = aio:actions()
|
||||
local labels = ""
|
||||
|
||||
labels = map(actions, function(it) return it.label end)
|
||||
names = map(actions, function(it) return it.name end)
|
||||
ui:show_lines(names, labels)
|
||||
end
|
||||
|
||||
function map(tbl, f)
|
||||
local ret = {}
|
||||
for k,v in pairs(tbl) do
|
||||
ret[k] = f(v)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
23
dev/aiocolors-widget.lua
Normal file
23
dev/aiocolors-widget.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-- name = "AΙΟ colors"
|
||||
-- type = "widget"
|
||||
-- description = "Shows colors returned by aio:colors() function"
|
||||
--foldable = "true"
|
||||
-- author = "Theodor Galanis"
|
||||
-- version = "1"
|
||||
|
||||
function on_resume()
|
||||
local colors = aio:colors()
|
||||
local colors_strings = stringify_table(colors)
|
||||
|
||||
ui:show_lines(colors_strings)
|
||||
end
|
||||
|
||||
function stringify_table(tab)
|
||||
local new_tab = {}
|
||||
|
||||
for k,v in pairs(tab) do
|
||||
table.insert(new_tab, k..": "..tostring(v))
|
||||
end
|
||||
|
||||
return new_tab
|
||||
end
|
||||
23
dev/aiowidgetslist-widget.lua
Normal file
23
dev/aiowidgetslist-widget.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
-- name = "AΙΟ widgets list"
|
||||
-- type = "widget"
|
||||
-- description = "Shows widgets returned by aio:available_widgets() function"
|
||||
--foldable = "true"
|
||||
-- author = "Theodor Galanis"
|
||||
-- version = "1"
|
||||
|
||||
function on_resume()
|
||||
actions = aio:available_widgets()
|
||||
local labels = ""
|
||||
|
||||
labels = map(actions, function(it) return it.label end)
|
||||
names = map(actions, function(it) return it.name end)
|
||||
ui:show_lines(names, labels)
|
||||
end
|
||||
|
||||
function map(tbl, f)
|
||||
local ret = {}
|
||||
for k,v in pairs(tbl) do
|
||||
ret[k] = f(v)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
Reference in New Issue
Block a user