-
I write custom lua file for plus plugins and paste at the end from tips, but doesnt work the user/group showing. The full code the following:
The file name: status-name-function.lua and with this code the status is totally empty. Before user/group code works status bar with symlink. |
Beta Was this translation helpful? Give feedback.
Answered by
sxyazi
Jan 3, 2024
Replies: 1 comment 8 replies
-
Hi, this is a new feature added yesterday. You'll need to use the latest main branch to make it work. Also, you don't need to copy the entire file, just: -- ~/.config/yazi/init.lua
function Status:owner()
local h = cx.active.current.hovered
if h == nil or ya.target_family() ~= "unix" then
return ui.Line {}
end
return ui.Line {
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
ui.Span(":"),
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
ui.Span(" "),
}
end
function Status:render(area)
self.area = area
local left = ui.Line { self:mode(), self:size(), self:name() }
local right = ui.Line { self:owner(), self:permissions(), self:percentage(), self:position() }
local progress = self:progress(area, right:width())
return {
ui.Paragraph(area, { left }),
ui.Paragraph(area, { right }):align(ui.Paragraph.RIGHT),
table.unpack(progress),
}
end is enough. |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
og900aero
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, this is a new feature added yesterday. You'll need to use the latest main branch to make it work. Also, you don't need to copy the entire file, just: