From cc3e74e099604390274fdcc0346afc3f65377d8f Mon Sep 17 00:00:00 2001 From: Artem Tarasov Date: Mon, 20 May 2024 20:06:14 +0200 Subject: [PATCH] show album year in the popup --- 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 57518d5..193d6a3 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -29,7 +29,7 @@ function playerctl:cmd(cmd) end function playerctl:watch(timeout, callback, widget) - local cmd = self:cmd("-f '{{status}};{{xesam:artist}};{{xesam:title}};{{mpris:artUrl}};{{position}};{{mpris:length}};{{album}}' metadata") + local cmd = self:cmd("-f '{{status}};{{xesam:artist}};{{xesam:title}};{{mpris:artUrl}};{{position}};{{mpris:length}};{{album}};{{xesam:contentCreated}}' metadata") self.watch_params = {timeout = timeout, callback = callback, widget = widget} @@ -50,6 +50,7 @@ function playerctl:watch(timeout, callback, widget) position = position, length = length, album = words[7], + year = string.sub(words[8], 0, 4), progress = progress, } @@ -238,14 +239,13 @@ local function worker(user_args) local metadata_widget = wibox.widget { widget = wibox.widget.textbox, font = font, - forced_height = 100, forced_width = popup_width, } local update_metadata = function(meta) artist_widget:set_text(meta.artist) title_widget:set_text(meta.current_song) - metadata_widget:set_text(string.format('%s - %s (%s/%s)', meta.album, meta.current_song, duration(meta.position), duration(meta.length))) + metadata_widget:set_text(string.format('%s (%s)\n%s (%s/%s)', meta.album, meta.year, meta.current_song, duration(meta.position), duration(meta.length))) progress_widget.value = meta.progress -- poor man's urldecode