From: luke bonham Date: Fri, 30 Jan 2015 13:12:13 +0000 (+0100) Subject: mpd: mpd_now.elapsed seconds fixed X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/d46745e1b37c62ebc08280e1b8e7197d56016bd0?ds=inline;hp=3261164a88bc052e88172b4bc73d24846ad7468e mpd: mpd_now.elapsed seconds fixed --- diff --git a/widgets/mpd.lua b/widgets/mpd.lua index 0d43e34..c10eb78 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -14,10 +14,11 @@ local escape_f = require("awful.util").escape local naughty = require("naughty") local wibox = require("wibox") -local io = { popen = io.popen } local os = { execute = os.execute, getenv = os.getenv } +local math = { floor = math.floor } local string = { format = string.format, + match = string.match, gmatch = string.gmatch } local setmetatable = setmetatable @@ -72,7 +73,7 @@ local function worker(args) elseif k == "Album" then mpd_now.album = escape_f(v) elseif k == "Date" then mpd_now.date = escape_f(v) elseif k == "Time" then mpd_now.time = v - elseif k == "elapsed" then mpd_now.elapsed = math.floor(v) + elseif k == "elapsed" then mpd_now.elapsed = string.match(v, "%d+") end end end