-
Notifications
You must be signed in to change notification settings - Fork 1
/
pekwm.lua
58 lines (42 loc) · 1017 Bytes
/
pekwm.lua
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
--[[
-- PEKWM ***************************************
]]--
function PekWM_ItemsWrite(S, group)
local name, value
for name,item in pairs(group)
do
if item.type=="group"
then
PekWM_SubmenuWrite(S, item)
elseif item.invoke ~= nil
then
S:writeln(" Entry = \"".. item.name .. "\" { Actions = \"Exec " .. item.invoke .. " &\" }\n")
end
end
end
function PekWM_SubmenuWrite(S, group)
local conf, name
S:writeln(" Submenu = \"" .. group.name .."\" {\n")
PekWM_ItemsWrite(S, group)
S:writeln(" }\n")
end
function PekWM_MenuWrite(menu, Path)
local i, item, S
S=OpenOutputFile(Path)
if S ~= nil
then
S:writeln("RootMenu = \"Applications\" {\n")
if #faves_config > 0
then
PekWM_ItemsWrite(S, faves_config)
S:writeln("Separator {}\n")
end
PekWM_ItemsWrite(S, menu)
S:writeln("Separator {}\n")
S:writeln("Entry=\"Reload\" { Actions = \"Reload\" }\n")
S:writeln("Entry=\"Restart\" { Actions = \"Restart\" }\n")
S:writeln("Entry=\"Exit\" { Actions = \"Exit\" }\n")
S:writeln("}\n")
S:close()
end
end