-
How to create a Linemode:custom() such that it displays the mimetype (text, directory, jpeg, etc) and the file size (human readable, such as kB, MB, GB) ? Currently what I have is: function Linemode:custom()
-- local mimetype = self_file.mimetype
local size = self._file:size()
size = size and ya.readable_size(size) or ""
return ui.Line(string.format("%s", size))
-- return ui.Line(string.format("%s %s", size, mimetype))
end |
Beta Was this translation helpful? Give feedback.
Answered by
sxyazi
Jul 23, 2024
Replies: 1 comment
-
You can get the mimetype of a file by |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
uwla
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can get the mimetype of a file by
mime()
, https://yazi-rs.github.io/docs/plugins/types#app-data.folder-file