How to use playerctl with mpd to control music with the media keys for mpd and other players

0

I used to have my media keys bound to prev/next/pause with i3 like so

bindsym XF86AudioPrev exec --no-startup-id mpc prev

But I wanted to also use other players so I set it to

bindsym XF86AudioPlay         exec --no-startup-id playerctl play-pause

which runs via the D-Bus and controls all media players that follow the MPRIS Spec readme

So is there a MPRIS module for mpd or an adapter that runs as a service and translates the mpris signals for the mpd? I couldn't find any, but it would be nice to use the media keys for both, not just for one XOR the other.

pascalwhoop

Posted 2018-07-19T05:12:59.237

Reputation: 233

Answers

0

The MPRIS v2 gateway for mpd is mpDris2.

(I'm affiliated with the project, but I don't know of any other software which implements MPRIS v2, only one for the obsolete and incompatible MPRIS v1.)

user1686

Posted 2018-07-19T05:12:59.237

Reputation: 283 655

I added a configuration as file as described in the README and it worked like a charm! The application doesn't run as a service so I also added a line to autostart it with i3. Thank you – pascalwhoop – 2018-07-19T07:51:48.960

1mpDris2 cannot be a system service, because MPRIS is provided on the session bus (which is individual for each session). You could run it as a systemd --user service if your distro chose the "user bus" model, but it's easiest to consider it a desktop/session service. – user1686 – 2018-07-19T07:53:51.547

0

As an alternative to mpDris2, I'd recommend: mpd-mpris. It is an implementation of the same idea but in Golang and not in Python and thus it is much lighter and it doesn't have runtime dependencies.

Doron Behar

Posted 2018-07-19T05:12:59.237

Reputation: 181