lcpz / lain

Awesome WM complements
GNU General Public License v2.0
1.05k stars 212 forks source link

Add format for fs widget #554

Open letmorfin opened 1 year ago

letmorfin commented 1 year ago

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)) }