Home

Awesome

mpd-mpris

AUR version AUR version Flake is available Matrix chat

An implementation of the MPRIS protocol for MPD.


Installation

Probably needs Go v1.9 or newer.

go install github.com/natsukagami/mpd-mpris/cmd/mpd-mpris

For Arch Linux users

The mpd-mpris package is available in the official repository.

Autostart

Service files are provided for both the Systemd and OpenRC init systems. To enable the Systemd service run:

systemctl --user --now enable mpd-mpris

To run the OpenRC service, copy services/mpd-mpris to /etc/init.d and run:

rc-update add mpd-mpris default

For Nix users

The repository provides the mpd-mpris package, overlay and a NixOS/home-manager module (services.mpd-mpris) as a flake.

# nix flake show github:natsukagami/mpd-mpris
github:natsukagami/mpd-mpris
├───devShells
│   ├───aarch64-darwin
│   │   └───default: development environment 'nix-shell'
│   ├───aarch64-linux
│   │   └───default: development environment 'nix-shell'
│   ├───x86_64-darwin
│   │   └───default: development environment 'nix-shell'
│   └───x86_64-linux
│       └───default: development environment 'nix-shell'
├───homeManagerModules:
│   └───default: home-manager module
├───nixosModules
│   └───default: NixOS module
├───overlays
│   └───default: Nixpkgs overlay
└───packages
    ├───aarch64-darwin
    │   └───default: package 'mpd-mpris'
    ├───aarch64-linux
    │   └───default: package 'mpd-mpris'
    ├───x86_64-darwin
    │   └───default: package 'mpd-mpris'
    └───x86_64-linux
        └───default: package 'mpd-mpris'

The mpd-mpris module has the following options:

Per-instance configurations:

Each instance will create a mpd-mpris-{name} service (with the default being mpd-mpris), with the MPRIS instance name org.mpris.MediaPlayer2.mpd.{name} (with the default being just org.mpris.MediaPlayer2.mpd). All per-instance configurations are available without the instances.{name} infix, and will apply to the default instance.

Running

# mpd-mpris --help
Usage of mpd-mpris:
  -host string
        The MPD host (default localhost)
  -instance-name string
        Set the MPRIS's interface as 'org.mpris.MediaPlayer2.mpd.{instance-name}'
  -network string
        The network used to dial to the mpd server. Check https://golang.org/pkg/net/#Dial for available values (most common are "tcp" and "unix") (default "tcp")
  -no-instance
        Set the MPRIS's interface as 'org.mpris.MediaPlayer2.mpd' instead of 'org.mpris.MediaPlayer2.mpd.instance#'
  -port int
        The MPD port. Only works if network is "tcp". If you use anything else, you should put the port inside addr yourself. (default 6600)
  -pwd string
        The MPD connection password. Leave empty for none.
  -pwd-file string
        Path to the file containing the mpd server password.

Will block for requests and log them down so you may want to run and forget.

Questions?

Join our Matrix channel at #mpd-mpris:matrix.org.

Implementation Status

License

MIT