From cdeed22ba5d6a657d1e090587fa84b0ac99fda20 Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Mon, 23 Aug 2021 10:56:34 +0300 Subject: [PATCH 1/3] mpris-widget: fix README, typo --- mpris-widget/README.md | 2 +- mpris-widget/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mpris-widget/README.md b/mpris-widget/README.md index 1978914..7efad78 100644 --- a/mpris-widget/README.md +++ b/mpris-widget/README.md @@ -21,6 +21,6 @@ s.mytasklist, -- Middle widget { -- Right widgets layout = wibox.layout.fixed.horizontal, ... - mpris_widget, + mpris_widget(), ... ``` diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua index d8620fb..83cb3e5 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -129,7 +129,7 @@ end local function worker() - -- retriving song info + -- retrieve song info local current_song, artist, mpdstatus, art, artUrl local icon = wibox.widget { From cede33fa3f1418adc0714c85a2cfed42afdd4335 Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Mon, 23 Aug 2021 11:06:44 +0300 Subject: [PATCH 2/3] mpris-widget: fix call to set_text .set_text is invalid, it should be :set_text like in the other branches of the if. --- mpris-widget/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua index 83cb3e5..c6b2ca6 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -52,8 +52,8 @@ local mpris_widget = wibox.widget{ widget = wibox.widget.textbox }, layout = wibox.layout.fixed.horizontal, - set_text = function(self, artis, title) - self:get_children_by_id('artist')[1]:set_text(artis) + set_text = function(self, artist, title) + self:get_children_by_id('artist')[1]:set_text(artist) self:get_children_by_id('title')[1]:set_text(title) end } @@ -188,7 +188,7 @@ local function worker() icon.image = PAUSE_ICON_NAME widget.colors = {beautiful.widget_main_color} mpdarc_current_song_widget.markup = current_song - widget.set_text(artist, current_song) + widget:set_text(artist, current_song) elseif mpdstatus == "Stopped" then mpdarc_icon_widget.visible = true icon.image = STOP_ICON_NAME From 540d5edb5f89b9797bcbf7bab16b5e1c869fbb73 Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Mon, 23 Aug 2021 11:17:36 +0300 Subject: [PATCH 3/3] 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. --- mpris-widget/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua index c6b2ca6..7669b10 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -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]