JakeStanger / mpd-discord-rpc

Rust application which displays your currently playing song / album / artist from MPD in Discord using Rich Presence.
https://crates.io/crates/mpd-discord-rpc
MIT License
88 stars 16 forks source link
discord discord-rpc mopidy mpd music rpc rust

MPD Discord RPC

crates.io aur

Displays your currently playing song / album / artist from MPD in Discord using Rich Presence, along with the album art.

It includes support for multiple MPD hosts if, like me, you have more than one server you alternate between.

The program does not require MPD or Discord to be running in order to run.

Once installed just run mpd-discord-rpc.

status image

Installation

Cargo

The cargo package can be found here.

cargo install mpd-discord-rpc

Arch Linux

Two AUR packages are available:

The systemd unit is included and can be started with:

systemctl --user enable --now mpd-discord-rpc 

NixOS

You can use the mpd-discord-rpc package in nixpkgs. Users of home-manager can also use the services.mpd-discord-rpc.enable option.

Many thanks to Ilan Joselevich for maintaining both of those.

Configuration

Running the program once will generate a default configuration file. On Linux this will be at ~/.config/discord-rpc/config.toml

Formatting Tokens

Any part of the format string that does not match one of these tokens will be displayed as is. The following will automatically be replaced with their value from MPD:

Default Configuration

This configuration file is automatically generated if one does not exist. It is included here for reference.

id = 677226551607033903
hosts = ["localhost:6600"]

[format]
details = "$title"
state = "$artist / $album"
timestamp = "elapsed"
large_image = "notes"
small_image = "notes"
large_text = ""
small_text = ""

Album art

Album art is pulled from the MusicBrainz database and Album Art Archive automatically. You'll only get a cover if it can be found though; there's a couple of things you can do to help this: