From aacbf61fac0e0a52ddd641699c373745de547c9f Mon Sep 17 00:00:00 2001 From: Romanos Skiadas Date: Fri, 15 Oct 2021 18:19:00 +0300 Subject: mpris-widget: enable notification on mouse enter use the right widget and it just works(TM). Changed the title to not have bold formatting, as it's already formatted and the was printed literally, changed the by to - as it looks nicer to me. --- mpris-widget/init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mpris-widget/init.lua') diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua index 0f84161..0398951 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -208,7 +208,7 @@ local function worker() local notification - local function show_MPD_status() + local function show_status() spawn.easy_async(GET_MPD_CMD, function() notification = naughty.notify { margin = 10, @@ -216,17 +216,17 @@ local function worker() hover_timeout = 0.5, width = 240, height = 90, - title = "" .. player_status .. "", - text = current_song .. " by " .. artist, + title = player_status, + text = current_song .. " - " .. artist, image = artUrl } end) end - mpdarc:connect_signal("mouse::enter", function() - if current_song ~= nil and artist ~= nil then show_MPD_status() end + mpris_widget:connect_signal("mouse::enter", function() + if current_song ~= nil and artist ~= nil then show_status() end end) - mpdarc:connect_signal("mouse::leave", function() naughty.destroy(notification) end) + mpris_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end) watch(string.format(GET_MPD_CMD, "'" .. default_player .. "'"), 1, update_graphic, mpris_widget) -- cgit v1.2.3