-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpwm.lua
More file actions
64 lines (47 loc) · 1.02 KB
/
pwm.lua
File metadata and controls
64 lines (47 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--[[
-- PWM ***************************************
]]--
function PWM_ItemsWrite(S, group)
local name, value
for name,item in pairs(group.items)
do
if item.type == "group"
then
S:writeln(" submenu \"".. item.title .. "\"\n")
elseif item.invoke ~= nil
then
S:writeln(" entry \"".. item.title .. "\", \"exec\", \"" .. item.invoke .. "\"\n")
end
end
end
function PWM_SubmenusWrite(S, group)
local name, value
for name,item in pairs(group.items)
do
if item.type=="group"
then
S:writeln(" menu \"" .. item.name .."\", \"".. item.title.."\" {\n")
PWM_ItemsWrite(S, item)
S:writeln(" }\n")
end
end
end
function PWM_MenuWrite(menu, Path)
local i, item, S
S=OpenOutputFile(Path)
if S ~= nil
then
PWM_SubmenusWrite(S, menu)
S:writeln("menu \"root_menu\", \"Applications\" {\n")
if #faves_config > 0
then
PWM_ItemsWrite(S, faves_config)
S:writeln("Separator {}\n")
end
PWM_ItemsWrite(S, menu)
S:writeln("entry \"Restart\", \"restart\"\n")
S:writeln("entry \"Exit\", \"exit\"\n")
S:writeln("}\n")
S:close()
end
end