lazykern / mprisence

A Discord Rich Presence client for MPRIS-compatible media players with support for album art.
MIT License
19 stars 1 forks source link
discord mpris rich-presence

mprisence

Playing Paused
No icon Playing, No icon Paused, No icon
Show icon Playing, Show icon Paused, Show icon
No cover Playing, No cover Paused, No cover

A Discord Rich Presence client for MPRIS-compatible media players with album/song cover art support

Installation

Arch

You can install mprisence from AUR

paru -S mprisence # or any other AUR helpers

Other

You can install mprisence from the source by

Using my script

curl -s https://raw.githubusercontent.com/lazykern/mprisence/main/scripts/install.sh | bash -s

Manually (See autostarting)

cargo install --git "https://github.com/lazykern/mprisence.git"

Usage

To start mprisence, simply run this command:

mprisence

See also:

Configuration

The rich presence can be configured to the user's preference by providing the configuration file at ~/.config/mprisence/config.toml or $XDG_CONFIG_HOME/mprisence/config.toml.

See Example config file for more details on configuration.

To download the example config file:

curl -s https://raw.githubusercontent.com/lazykern/mprisence/main/scripts/example-config.sh | bash -s

See also:

Cover Art

Fetching from MusicBrainz

The cover art will be fetched from MusicBrainz API. Note that the result is not guaranteed to always be available nor correct. To reduce the chance of missing cover art:

Using ImgBB

Will upload the cover art from player metadata or audio tag to ImgBB and use the uploaded image as the cover art.

The user must set the ImageBB API key in the configuration file by providing the key as below. And make sure to add provider = ["imgbb"] to [cover.provider] in the config file.

[cover.provider.imgbb]
api_key = "<YOUR API KEY>"

Note

The application must be restarted after the configuration file is updated

Autostarting

For most Linux distributions, you can use systemd to autostart mprisence.

Installed from AUR

systemctl --user enable --now mprisence.service

Installed from source

Using my script

curl -s https://raw.githubusercontent.com/lazykern/mprisence/main/scripts/autostart.sh | bash -s

Manually

sudo ln -s $(which mprisence) /usr/local/bin/mprisence
mkdir -p "$HOME/.config/systemd/user"
curl https://raw.githubusercontent.com/lazykern/mprisence/main/systemd/mprisence-local.service >"$HOME/.config/systemd/user/mprisence.service"
systemctl --user daemon-reload
systemctl --user enable --now mprisence.service

If the configuration file is updated, you must restart the service

systemctl --user restart mprisence.service