-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
54 lines (43 loc) · 1.14 KB
/
init.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
local function spacer()
return ui.Span(" ")
end
local function nlink()
local h = cx.active.current.hovered
if not h then
return ui.Span("")
end
if not h.cha.nlink then
return ui.Span("")
end
return ui.Span(h.cha.nlink .. " ")
end
local function owner()
local h = cx.active.current.hovered
if not h or not h.cha.uid or not h.cha.gid then
return ui.Span("")
end
local user = ya.user_name(h.cha.uid) or h.cha.uid
local group = ya.group_name(h.cha.gid) or h.cha.gid
return ui.Line(string.format("%s:%s ", user, group))
end
local function mtime()
local h = cx.active.current.hovered
if not h then
return ui.Span("")
end
if not h.cha.modified then
return ui.Span("")
end
return ui.Span(os.date("%Y-%m-%d %H:%M", h.cha.modified // 1) .. " ")
end
return {
setup = function()
Status:children_remove(2, Status.LEFT) -- size
Status:children_remove(3, Status.LEFT) -- name
Status:children_remove(5, Status.RIGHT) -- percentage
Status:children_add(spacer, 1100, Status.RIGHT)
Status:children_add(nlink, 1200, Status.RIGHT)
Status:children_add(owner, 1300, Status.RIGHT)
Status:children_add(mtime, 1400, Status.RIGHT)
end,
}