2024-04-23 04:34:15 +02:00
|
|
|
require("starship"):setup()
|
2024-06-25 13:52:46 +02:00
|
|
|
|
|
|
|
-- Show symlink path in status bar
|
|
|
|
function Status:name()
|
|
|
|
local h = cx.active.current.hovered
|
|
|
|
if not h then
|
|
|
|
return ui.Span("")
|
|
|
|
end
|
|
|
|
|
|
|
|
local linked = ""
|
|
|
|
if h.link_to ~= nil then
|
|
|
|
linked = " -> " .. tostring(h.link_to)
|
|
|
|
end
|
|
|
|
return ui.Span(" " .. h.name .. linked)
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Remove file size from status bar
|
|
|
|
function Status:render(area)
|
|
|
|
self.area = area
|
|
|
|
|
|
|
|
local left = ui.Line { self:mode(), self:name() }
|
|
|
|
local right = ui.Line { self:permissions(), self:position() }
|
|
|
|
return {
|
|
|
|
ui.Paragraph(area, { left }),
|
|
|
|
ui.Paragraph(area, { right }):align(ui.Paragraph.RIGHT),
|
|
|
|
table.unpack(Progress:render(area, right:width())),
|
|
|
|
}
|
|
|
|
end
|