X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/52deb6911957f840a0191f73c8a9626bd9ff5086..f619c08b5fb849c8f0ac94677c7b4a18190cdf23:/widgets/contrib/moc.lua?ds=inline 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