-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp_group.lua
More file actions
63 lines (43 loc) · 956 Bytes
/
app_group.lua
File metadata and controls
63 lines (43 loc) · 956 Bytes
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
62
63
-- This module contains functions related to 'groups' of applications that are ultimately shown
-- in window manager menus. Example groups might be "Games", "FileManagers", "Terminals" etc
function NewGroup(name)
local group, id
id=string.lower(name)
if group_configs[id] == nil
then
group={}
group.type="group"
group.name=id
group.title=name
group.ignore=false
group.icons=""
group.items={}
group_configs[id]=group
end
return group_configs[id]
end
function FindGroup(name)
local id
if name == nil then return nil end
id=string.lower(name)
return(group_configs[id])
end
function CopyGroupItems(in_group, out_group)
local name, item
for i,item in pairs(in_group.items)
do
if item.type ~= nil
then
out_group.items[item.name]=item
end
end
end
function GroupCountItems(group)
local count=0
if group == nil then return 0 end
for name, item in pairs(group.items)
do
count=count+1
end
return count
end