]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/network_widget.lua
zsh: use pinentry-curses when connected over ssh
[dotfiles.git] / awesome / widgets / network_widget.lua
index 36c72e7f77dad7c95a4ea98d9ec91d056f84bacb..1a76888146e7570705ca1cde70d2789bb803c0af 100644 (file)
@@ -1,22 +1,15 @@
-local wibox = require("wibox")
-local vicious = require("vicious")
 local utils = require("utils")
+local net_widget = require("widgets/net_widgets")
 
-module("network_widget")
-
-local intf = ""
-if utils.host == "chronos" then intf = "wlp3s0" end
-if utils.host == "shada"   then intf = "enp3s0" end
-
-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
 
-network_widget = wibox.widget.textbox()
-vicious.register(network_widget, vicious.widgets.net, netclosure(intf), 1)
-
-return network_widget
+return widget