Closed Aproxia-dev closed 1 year ago
Here's an example notification using said extra metadata.
And here's the code:
playerctl:connect_signal("metadata", function(_, title, artist, album_path, album, new, player_name, extra)
if new == true then
naughty.notify {
title = extra.track .. ". " .. artist .. " - " .. title,
text = "from <b><i>" .. album .. "</i></b> (" .. extra.year .. ")",
image = album_path,
app_name = player_name,
app_icon = gc.recolor_image(icons.music, beautiful.notifs)
}
end
end)
@JavaCafe01 Maybe we pass in a table instead of having so much values? We'll add it in a new signal for backwards compatibillity and keep the old one the same way
@JavaCafe01 Maybe we pass in a table instead of having so much values? We'll add it in a new signal for backwards compatibillity and keep the old one the same way
Yup, that makes sense.
It definitely makes a lot of sense to make a new signal for it at this point. Passing so many values into a signal like that looks very silly. How should the new signal be called, though?
It definitely makes a lot of sense to make a new signal for it at this point. Passing so many values into a signal like that looks very silly. How should the new signal be called, though?
The same. I mean, this is all metadata. Also, there should be some sort of checker that sees if the user is using the old method and notifies them.
Ping @Aproxia-dev
Ping @Aproxia-dev
Closing this as I rewrote the whole thing and made a new PR. #207
I'll admit that the way i did it is not the greatest. I tried not to make it a breaking change.
An alternative solution would be giving access to
metadata.value
to the user directly, which would probably be a whole lot nicer and easier to implement than this load of crap as well.