]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/network_widget.lua
awesome: autostart qutebrowser instead of dwb
[dotfiles.git] / awesome / widgets / network_widget.lua
index 59ebeec3962fb11e8850b73ae887289d7a36b1c1..d135f1e00ffd95e694c5c993b6551094ae404855 100644 (file)
@@ -1,20 +1,18 @@
-local wibox = require("wibox")
-local vicious = require("vicious")
-local naughty = require("naughty")
-local beautiful = require("beautiful")
-local pairs = pairs
+local utils = require("utils")
+local net_widget = require("widgets/net_widgets")
 
-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
+local widget
+if utils.host == "chronos" then
+    widget = net_widget.wireless({interface="wlp3s0", command_mode="newer", font='monospace'})
+end
+if utils.host == "smartlab-imac2" then
+    widget = net_widget.wireless({interface="wlp3s0", command_mode="newer", font='monospace'})
+end
+if utils.host == "shada" then
+    widget = net_widget.indicator({interfaces={"enp3s0"}, command_mode="newer", font='monospace'})
+end
+if utils.host == "sb-arch" then
+    widget = net_widget.indicator({interfaces={"enp2s0"}, command_mode="newer", font='monospace'})
 end
 
-network_widget = wibox.widget.textbox()
-vicious.register(network_widget, vicious.widgets.net, netclosure("enp3s0"), 1)
-
-return network_widget
+return widget