BlingCorp / bling

Utilities for the awesome window manager
https://blingcorp.github.io/bling/
MIT License
851 stars 51 forks source link

Playerctl module: Added extra metadata #191

Closed Aproxia-dev closed 1 year ago

Aproxia-dev commented 1 year ago

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.

Aproxia-dev commented 1 year ago

Here's an example notification using said extra metadata.

image

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)
Kasper24 commented 1 year ago

@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 commented 1 year ago

@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.

Aproxia-dev commented 1 year ago

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?

javacafe01 commented 1 year ago

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.

javacafe01 commented 1 year ago

Ping @Aproxia-dev

javacafe01 commented 1 year ago

Ping @Aproxia-dev

Aproxia-dev commented 1 year ago

Closing this as I rewrote the whole thing and made a new PR. #207