awesome/src/widgets/6_net.lua

18 lines
591 B
Lua
Raw Normal View History

2024-07-06 20:31:50 +02:00
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('%7.2f', net_now.sent))
netdowninfo:set_text(string.format('%8.2f', net_now.received))
2024-07-06 20:31:50 +02:00
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),
}