patryk-ku / mpris-discord-rpc

MPRIS2 Discord music rich presence status with support for album covers and progress bar.
MIT License
6 stars 2 forks source link

Filter #7

Closed corngoblin closed 3 months ago

corngoblin commented 3 months ago

This is a pretty good little tool and the best one I've seen yet, but you should add a player filter at some point.

I wish I could set it to only pick up strawberry for example, or block Firefox from being picked up at all.

I don't need people to know I'm watching a video on youtube about the history of pancakes at 3 AM because I forgot about it running.

Keep up the amazing work.

In case anyone was wondering.. https://www.youtube.com/watch?v=SD3WKbXhm6M

patryk-ku commented 3 months ago

Yes, I am aware of the fact that this needs some sort of white/black list.

For now, you can use the -n or --player-name argument to get data from only one specified player. I wrote about this in the readme here.

But in short. You can list all active players with this argument:

./mpris-discord-rpc --list-players

Then copy exact player name from list and use it with -n or --player-name argument like this:

./mpris-discord-rpc --player-name "Insert name here"

So for example for VLC use it like this:

./mpris-discord-rpc --player-name "VLC media player"

From now on it will only listen to this one player and ignore the others.

I had planned to add white/blacklist functionality to filter players but didn't really need such a feature so I forgot about it. But as you ask, I will add such an option in the near future (this weekend maybe) as it won't be a big problem.

corngoblin commented 3 months ago

I missed seeing that and that's totally my bad.

Thank you very much for your work.

patryk-ku commented 3 months ago

So in version v0.1.4, I added an allowlist to filter music players:

./mpris-discord-rpc -a "VLC Media Player" -a "Chrome" -a "Any other player"

This is incompatible with the previous -n argument so you can use either -a or -n but not both at once.

Btw thanks for the kind words, I wrote this tool just for me and I'm happy that it could still be useful for someone else.