if utils.host == "chronos" then
local battery_widget = require("widgets/battery_widget")
end
+local network_widget = require("widgets/network_widget")
+
-- Create a textclock widget
mytextclock = awful.widget.textclock()
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then right_layout:add(wibox.widget.systray()) end
+ right_layout:add(network_widget)
right_layout:add(volume_widget)
if utils.host == "chronos" then
right_layout:add(battery_widget)
--- /dev/null
+local wibox = require("wibox")
+local vicious = require("vicious")
+local naughty = require("naughty")
+local beautiful = require("beautiful")
+local pairs = pairs
+
+module("network_widget")
+
+local function netclosure(intf)
+ return function (_, args)
+ local up_mb = args["{"..intf.." up_kb}"]
+ local down_mb = args["{"..intf.." down_kb}"]
+ return "Net: ↑"..up_mb.." ↓"..down_mb
+ end
+end
+
+network_widget = wibox.widget.textbox()
+vicious.register(network_widget, vicious.widgets.net, netclosure("enp3s0"), 1)
+
+return network_widget