summaryrefslogtreecommitdiff
path: root/mpris-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2021-09-01 15:11:42 -0400
committerGitHub <noreply@github.com>2021-09-01 15:11:42 -0400
commit3b24474de4646519634b842edbc539d49c55abbb (patch)
tree4126d6fb9f54671ed4b157f9fd4f608ecd3f7d9b /mpris-widget
parentdbb474eaf7363b735e3fa53e43ce3bbbf7a69df7 (diff)
parent540d5edb5f89b9797bcbf7bab16b5e1c869fbb73 (diff)
Merge pull request #294 from rski/master
mpris-widget: Misc fixes to get it in a working state
Diffstat (limited to 'mpris-widget')
-rw-r--r--mpris-widget/README.md2
-rw-r--r--mpris-widget/init.lua10
2 files changed, 6 insertions, 6 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..7669b10 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
}
@@ -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 {
@@ -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]
@@ -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