Skip to content

I want custom linemod, but I get error message #553

Closed Locked Answered by sxyazi
og900aero asked this question in Q&A
Discussion options

You must be logged in to vote

Add these lines to your ~/.config/yazi/init.lua

local old_linemode = Folder.linemode
function Folder:linemode(area, files)
  if cx.active.conf.linemode ~= "my-own" then
    return old_linemode(self, area)
  end

  local lines = {}
  local year = os.date("%Y")
  for _, f in ipairs(files) do
    local time = f.cha.modified // 1
    if time and os.date("%Y", time) == year then
      time = os.date("%b %d  %Y", time)
    else
      time = time and os.date("%b %d %H:%M", time) or ""
    end

    local size = f:size()
    lines[#lines + 1] = ui.Line {
      ui.Span(" "),
      ui.Span(size and ya.readable_size(size):gsub(" ", "") or "-"),
      ui.Span(" "),
      ui.Span(time),
      ui.Span(" "

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by og900aero
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants