mpris-widget: fix capture regex for playerctl output

Before, the table ended up being something like {"status", "",
"artist", "", ..}, so the output of the widget was garbled.
This commit is contained in:
Romanos Skiadas 2021-08-23 11:17:36 +03:00
parent cede33fa3f
commit 540d5edb5f
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ local function worker()
local update_graphic = function(widget, stdout, _, _, _)
-- mpdstatus, artist, current_song = stdout:match("(%w+)%;+(.-)%;(.*)")
local words = {}
for w in stdout:gmatch("([^;]*)") do table.insert(words, w) end
for w in stdout:gmatch("([^;]*);") do table.insert(words, w) end
mpdstatus = words[1]
artist = words[2]