diff options
Diffstat (limited to 'widgets/net.lua')
-rw-r--r-- | widgets/net.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/widgets/net.lua b/widgets/net.lua index 9eda942..5991b40 100644 --- a/widgets/net.lua +++ b/widgets/net.lua @@ -14,7 +14,7 @@ local helpers = require("vicious.helpers") -- }}} --- Net: provides usage statistics for all network interfaces +-- Net: provides state and usage statistics of all network interfaces module("vicious.widgets.net") @@ -43,6 +43,10 @@ local function worker(format) helpers.uformat(args, name .. " rx", recv, unit) helpers.uformat(args, name .. " tx", send, unit) + -- Operational state and carrier detection + local sysnet = helpers.pathtotable("/sys/class/net/" .. name) + args["{"..name.." carrier}"] = tonumber(sysnet.carrier) or 0 + if nets[name] == nil then -- Default values on the first run nets[name] = {} |