X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/52deb6911957f840a0191f73c8a9626bd9ff5086..b07aad86215f84f5d17433f751ba246da364df2b:/widgets/contrib/moc.lua diff --git a/widgets/contrib/moc.lua b/widgets/contrib/moc.lua index bd25ffb..b79dbe2 100644 --- a/widgets/contrib/moc.lua +++ b/widgets/contrib/moc.lua @@ -21,6 +21,8 @@ local string = { format = string.format, local setmetatable = setmetatable +-- MOC audio player +-- lain.widgets.contrib.moc local moc = {} local function worker(args) @@ -59,7 +61,7 @@ local function worker(args) total = "N/A" } - for line in f:lines() do + for line in string.gmatch(f, "[^\n]+") do for k, v in string.gmatch(line, "([%w]+):[%s](.*)$") do if k == "State" then moc_now.state = v elseif k == "File" then moc_now.file = v