X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/0bfa28f7491904bebefeb02efe6e020da2ed8cf8..f6cc2aedd67c1b63f14b8975ccb9a815d04117f6:/widgets/net.lua?ds=sidebyside diff --git a/widgets/net.lua b/widgets/net.lua index 2b06622..2585ad4 100644 --- a/widgets/net.lua +++ b/widgets/net.lua @@ -14,7 +14,6 @@ local naughty = require("naughty") local wibox = require("wibox") local io = { popen = io.popen } -local tostring = tostring local string = { format = string.format, gsub = string.gsub, match = string.match } @@ -71,10 +70,10 @@ local function worker(args) local now_r = helpers.first_line('/sys/class/net/' .. iface .. '/statistics/rx_bytes') or 0 - net_now.sent = tostring((now_t - net.last_t) / timeout / units) + net_now.sent = (now_t - net.last_t) / timeout / units net_now.sent = string.gsub(string.format('%.1f', net_now.sent), ",", ".") - net_now.received = tostring((now_r - net.last_r) / timeout / units) + net_now.received = (now_r - net.last_r) / timeout / units net_now.received = string.gsub(string.format('%.1f', net_now.received), ",", ".") widget = net.widget