From: luke bonham Date: Mon, 20 Oct 2014 13:56:44 +0000 (+0200) Subject: #68 solution attempt X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/89bb71e154283db9edd656518073200821374100?ds=sidebyside;hp=--cc #68 solution attempt --- 89bb71e154283db9edd656518073200821374100 diff --git a/widgets/net.lua b/widgets/net.lua index ed6a2ef..84751b6 100644 --- a/widgets/net.lua +++ b/widgets/net.lua @@ -31,9 +31,9 @@ function net.get_device() f = io.popen("ip link show | cut -d' ' -f2,9") ws = f:read("*a") f:close() - ws = ws:match("%w+: UP") + ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN") if ws ~= nil then - return ws:gsub(": UP", "") + return ws:match("(%w+):") else return "network off" end