Skip to content

Add format for fs widget #554

@letmorfin

Description

@letmorfin

Add a format for fs widget like this:
if size > 0 then
local units = math.floor(math.log(size)/math.log(1024))
fs_now[path] = {
units = fs.units[units],
percentage = math.floor(100 * used / size), -- used percentage
size = string.format("%.1f", size / math.pow(1024, units)),
used = string.format("%.1f", used / math.pow(1024, units)),
free = string.format("%.1f", free / math.pow(1024, units))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions