Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets

This commit is contained in:
streetturtle 2021-09-19 21:10:48 -04:00
commit af8d66855e
3 changed files with 7 additions and 7 deletions

View File

@ -21,7 +21,7 @@ It is possible to customize widget by providing a table with all or some of the
| Name | Default | Description | | Name | Default | Description |
|---|---|---| |---|---|---|
| `icon` | `./icons/gitlab-icon.svg` | Path to the icon | | `icon` | `./icons/gitlab-icon.svg` | Path to the icon |
| `host` | Required | e.g _https://gitlab.yourcomapny.com_ | | `host` | Required | e.g _https://gitlab.yourcompany.com_ |
| `access_token` | Required | e.g _h2v531iYASDz6McxYk4A_ | | `access_token` | Required | e.g _h2v531iYASDz6McxYk4A_ |
| `timeout` | 60 | How often in seconds the widget should be refreshed | | `timeout` | 60 | How often in seconds the widget should be refreshed |

View File

@ -21,6 +21,6 @@ s.mytasklist, -- Middle widget
{ -- Right widgets { -- Right widgets
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
... ...
mpris_widget, mpris_widget(),
... ...
``` ```

View File

@ -52,8 +52,8 @@ local mpris_widget = wibox.widget{
widget = wibox.widget.textbox widget = wibox.widget.textbox
}, },
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
set_text = function(self, artis, title) set_text = function(self, artist, title)
self:get_children_by_id('artist')[1]:set_text(artis) self:get_children_by_id('artist')[1]:set_text(artist)
self:get_children_by_id('title')[1]:set_text(title) self:get_children_by_id('title')[1]:set_text(title)
end end
} }
@ -129,7 +129,7 @@ end
local function worker() local function worker()
-- retriving song info -- retrieve song info
local current_song, artist, mpdstatus, art, artUrl local current_song, artist, mpdstatus, art, artUrl
local icon = wibox.widget { local icon = wibox.widget {
@ -163,7 +163,7 @@ local function worker()
local update_graphic = function(widget, stdout, _, _, _) local update_graphic = function(widget, stdout, _, _, _)
-- mpdstatus, artist, current_song = stdout:match("(%w+)%;+(.-)%;(.*)") -- mpdstatus, artist, current_song = stdout:match("(%w+)%;+(.-)%;(.*)")
local words = {} 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] mpdstatus = words[1]
artist = words[2] artist = words[2]
@ -188,7 +188,7 @@ local function worker()
icon.image = PAUSE_ICON_NAME icon.image = PAUSE_ICON_NAME
widget.colors = {beautiful.widget_main_color} widget.colors = {beautiful.widget_main_color}
mpdarc_current_song_widget.markup = current_song mpdarc_current_song_widget.markup = current_song
widget.set_text(artist, current_song) widget:set_text(artist, current_song)
elseif mpdstatus == "Stopped" then elseif mpdstatus == "Stopped" then
mpdarc_icon_widget.visible = true mpdarc_icon_widget.visible = true
icon.image = STOP_ICON_NAME icon.image = STOP_ICON_NAME