summaryrefslogtreecommitdiff
path: root/mpris-widget
diff options
context:
space:
mode:
authorRomanos Skiadas <rom.skiad@gmail.com>2021-10-15 18:19:00 +0300
committerRomanos Skiadas <rom.skiad@gmail.com>2021-10-15 18:23:26 +0300
commitaacbf61fac0e0a52ddd641699c373745de547c9f (patch)
tree3ff2c24f849b848d0b47125db760d060594f55fc /mpris-widget
parent2b829c72575bfd31aec5ad7606bc746025a9d027 (diff)
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 <b> was printed literally, changed the <b>by</b> to - as it looks nicer to me.
Diffstat (limited to 'mpris-widget')
-rw-r--r--mpris-widget/init.lua12
1 files changed, 6 insertions, 6 deletions
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 = "<b>" .. player_status .. "</b>",
- text = current_song .. " <b>by</b> " .. 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)