awesome-wm-widgets/_snippets/ellipsize.md

247 B

layout
page

Ellipsize

Ellipsizes string to a given length {:.filename}

local function ellipsize(text, length)
    return (text:len() > length and length > 0)
        and text:sub(0, length - 3) .. '...'
        or text
end