configs/i3/conky_lua/network.lua

9 lines
213 B
Lua
Raw Permalink Normal View History

2017-03-19 21:59:32 +01:00
--vim: ts=2 sw=2 noet sts=0
function conky_eth_link_speed(eth)
local f = assert(io.open("/sys/class/net/" .. eth .. "/speed", "r"))
local t = f:read("*all")
f:close()
return string.sub(t,1,-2) .. " Mbps"
end