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