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.
This commit is contained in:
parent
2b829c7257
commit
aacbf61fac
|
@ -208,7 +208,7 @@ local function worker()
|
||||||
|
|
||||||
|
|
||||||
local notification
|
local notification
|
||||||
local function show_MPD_status()
|
local function show_status()
|
||||||
spawn.easy_async(GET_MPD_CMD, function()
|
spawn.easy_async(GET_MPD_CMD, function()
|
||||||
notification = naughty.notify {
|
notification = naughty.notify {
|
||||||
margin = 10,
|
margin = 10,
|
||||||
|
@ -216,17 +216,17 @@ local function worker()
|
||||||
hover_timeout = 0.5,
|
hover_timeout = 0.5,
|
||||||
width = 240,
|
width = 240,
|
||||||
height = 90,
|
height = 90,
|
||||||
title = "<b>" .. player_status .. "</b>",
|
title = player_status,
|
||||||
text = current_song .. " <b>by</b> " .. artist,
|
text = current_song .. " - " .. artist,
|
||||||
image = artUrl
|
image = artUrl
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
mpdarc:connect_signal("mouse::enter", function()
|
mpris_widget:connect_signal("mouse::enter", function()
|
||||||
if current_song ~= nil and artist ~= nil then show_MPD_status() end
|
if current_song ~= nil and artist ~= nil then show_status() end
|
||||||
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)
|
watch(string.format(GET_MPD_CMD, "'" .. default_player .. "'"), 1, update_graphic, mpris_widget)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue