app_assets | ||
assets | ||
src | ||
.gitignore | ||
deezer-rich-presence.service | ||
LICENSE | ||
package.json | ||
pnpm-lock.yaml | ||
README.md | ||
tsconfig.json |
Deezer Discord Presence
This script provides Discord Rich Presence for Deezer by fetching playback data from the KDE Browser Integration via DBus.
This is a personal project tailored to my needs, so you will likely have to put in some effort or mess with the source code to get it working. I don't expect anyone else to be interested in using this, but I'm happy to accept issues and pull requests regardless.
Running
pnpm install # Install dependencies
pnpm run build
pnpm run start
A systemd user service deezer-rich-presence.service is provided, adjust the paths to your nodejs binary and the application directory and copy it to ~/.local/share/systemd/user/
.
Since I use Vencord with arrpc (which runs separately from Discord in the background), the service runs fine on my machine while Discord is closed - However, if you use the default Discord client, you will likely see the service crash repeatedly unless Discord is running.
I recommend using Vencord with arrpc instead of the default client as it is better in every regard than the stock client on Linux. Otherwise you'll have to deal with systemd stopping the service when it exits too frequently.
How it works
This is a very specific setup but can easily be adapted to other browsers or software, as long as they provide org.mpris.MediaPlayer2.Player
. Simply replace org.kde.plasma.browser_integration
in index.ts
with the appropriate name (can be found through busctl --user list
).
You'll likely want to replace the client ID too if you want to change the application name or artwork. The Rich Presence assets I use are in app_assets/.
Unfortunately, due to limitations with how this data is provided, this is not always reliable, especially when other media is playing in the same browser. For some reason, the length and progress timestamps are messed up too, but the latter usually works well enough™ to still be worth including.
Ideally this information would be collected through a custom browser extension, but as those can't directly connect to IPC, extra complexity involving a separate desktop client would be required.