-- {{{ Grab environment local tonumber = tonumber local os = { time = os.time } local helpers = require("vicious.helpers") local spawn = require("vicious.spawn") local string = { match = string.match, gmatch = string.gmatch } -- }}} -- Net: provides state and usage statistics of all network interfaces -- vicious.widgets.net local net_freebsd = {} -- Initialize function tables local nets = {} -- Variable definitions local unit = { ["b"] = 1, ["kb"] = 1024, ["mb"] = 1024^2, ["gb"] = 1024^3 } -- {{{ Net widget type local function parse(stdout, stderr, exitreason, exitcode) local args = {} local buffer = nil local now = os.time() for line in string.gmatch(stdout, "[^\n]+") do if not (line:find("