dictd wordnet refinements yazi
This commit is contained in:
parent
92fa4bb82d
commit
077f91494b
8 changed files with 141 additions and 32 deletions
|
@ -10,7 +10,7 @@ require("dir-rules"):setup()
|
|||
require("restore"):setup({
|
||||
position = { "center", w = 70, h = 40 },
|
||||
show_confirm = true,
|
||||
})
|
||||
})
|
||||
|
||||
Status:children_add(function()
|
||||
local h = cx.active.current.hovered
|
||||
|
@ -18,28 +18,28 @@ Status:children_add(function()
|
|||
|
||||
local btime_formatted = nil
|
||||
if h and h.cha and h.cha.btime then
|
||||
local timestamp_num = tonumber(h.cha.btime)
|
||||
if timestamp_num and timestamp_num > 0 then
|
||||
btime_formatted = os.date("%Y-%m-%d %H:%M", math.floor(timestamp_num))
|
||||
end
|
||||
local timestamp_num = tonumber(h.cha.btime)
|
||||
if timestamp_num and timestamp_num > 0 then
|
||||
btime_formatted = os.date("%Y-%m-%d %H:%M", math.floor(timestamp_num))
|
||||
end
|
||||
end
|
||||
|
||||
local mtime_formatted = nil
|
||||
if h and h.cha and h.cha.mtime then
|
||||
local timestamp_num = tonumber(h.cha.mtime)
|
||||
if timestamp_num and timestamp_num > 0 then
|
||||
mtime_formatted = os.date("%Y-%m-%d %H:%M", math.floor(timestamp_num))
|
||||
end
|
||||
local timestamp_num = tonumber(h.cha.mtime)
|
||||
if timestamp_num and timestamp_num > 0 then
|
||||
mtime_formatted = os.date("%Y-%m-%d %H:%M", math.floor(timestamp_num))
|
||||
end
|
||||
end
|
||||
|
||||
if btime_formatted then
|
||||
table.insert(elements, ui.Span("B:"):fg("cyan"))
|
||||
table.insert(elements, ui.Span(btime_formatted.. " "):fg("blue"))
|
||||
table.insert(elements, ui.Span("B:"):fg("cyan"))
|
||||
table.insert(elements, ui.Span(btime_formatted.. " "):fg("blue"))
|
||||
end
|
||||
|
||||
if mtime_formatted then
|
||||
table.insert(elements, ui.Span("M:"):fg("cyan"))
|
||||
table.insert(elements, ui.Span(mtime_formatted.. " "):fg("blue"))
|
||||
table.insert(elements, ui.Span("M:"):fg("cyan"))
|
||||
table.insert(elements, ui.Span(mtime_formatted.. " "):fg("blue"))
|
||||
end
|
||||
|
||||
return ui.Line(elements)
|
||||
|
@ -67,3 +67,28 @@ Status:children_add(function(self)
|
|||
return ""
|
||||
end
|
||||
end, 3300, Status.LEFT)
|
||||
|
||||
|
||||
function Linemode:time_and_size()
|
||||
local time = math.floor(self._file.cha.mtime or 0)
|
||||
if time == 0 then
|
||||
time = ""
|
||||
elseif os.date("%Y", time) == os.date("%Y") then
|
||||
time = os.date("%b %d %H:%M", time)
|
||||
else
|
||||
time = os.date("%b %d %Y", time)
|
||||
end
|
||||
|
||||
local size_str
|
||||
local size = self._file:size()
|
||||
if size then
|
||||
size_str = ya.readable_size(size)
|
||||
else
|
||||
-- file count for dirs
|
||||
local folder = cx.active:history(self._file.url)
|
||||
size_str = folder and tostring(#folder.files) or "-"
|
||||
end
|
||||
local size_formatted = string.format("%6s", size_str)
|
||||
|
||||
return string.format("%s %s", time, size_formatted)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue