X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6cc550655fad64e784ff87916f3ef439ebaf4c4a..d0229ec2e20c53d76255f2024f70f43dbed016a8:/widgets/net.lua?ds=sidebyside diff --git a/widgets/net.lua b/widgets/net.lua index d79e117..08c7366 100644 --- a/widgets/net.lua +++ b/widgets/net.lua @@ -35,7 +35,7 @@ function net.get_device() if ws ~= nil then return ws:gsub(": UP", "") else - return "" + return "network off" end end @@ -44,6 +44,7 @@ local function worker(args) local timeout = args.timeout or 2 local iface = args.iface or net.get_device() local units = args.units or 1024 --kb + local notify = args.notify or "on" local settings = args.settings or function() end net.widget = wibox.widget.textbox('') @@ -76,14 +77,12 @@ local function worker(args) net.last_t = now_t net.last_r = now_r - if net_now.carrier ~= "1" + if net_now.carrier ~= "1" and notify == "on" then if helpers.get_map(iface) then - n_title = iface - if n_title == "" then n_title = "network" end naughty.notify({ - title = n_title, + title = iface, text = "no carrier", timeout = 7, position = "top_left",