awesome/src/widgets/6_net.lua
2024-07-06 23:01:23 +02:00

18 lines
591 B
Lua

local wibox = require('wibox')
local lain = require('lain')
local theme = require('src.theme')
local netdowninfo = wibox.widget.textbox()
local netupinfo = lain.widget.net({
settings = function()
-- luacheck: globals widget net_now
widget:set_text(string.format('%6.1f', net_now.sent))
netdowninfo:set_text(string.format('%7.1f', net_now.received))
end,
})
return {
wibox.layout.fixed.horizontal(wibox.widget.imagebox(theme.widget_netdown), netdowninfo),
wibox.layout.fixed.horizontal(wibox.widget.imagebox(theme.widget_netup), netupinfo.widget),
}