Skip to main content

Discord Rich Presence for g4music.

Project description

G4music / Gapless Discord Rich Presence

Discord Rich Presense for Gapless

Features

  • Highly customisable
  • Templating for various fields
  • Buttons with customisable text and url
  • Cover art display (through litterbox)
  • Position display

Installation

[!CAUTION] g4music, and hence g4music-discord-rpc, do NOT work on Windows.

There are 2 options for installation:

  1. Pypi
python3 -m pip install g4music-discord-rpc
  1. Running from source
git clone https://github.com/x-9917638/g4music-discord-rpc
cd g4music-discord-rpc
python3 -m pip install -r requirements.txt
python3 src/main.py

Configuration

g4music-discord-rpc will create a default configuration at $XDG_CONFIG_HOME/g4music-discord-rpc/config.toml

Default:

[general]
appid = 1436573238636576891
cover-art = true
show-time = true
log-level = 30

[details]
text = ""
url = ""

[state]
text = "${song} / ${album} - ${artist}"
url = ""

[image]
text = "Listening to ${song}"
url = ""

[buttons.1]
text = ""
url = ""

[buttons.2]
text = ""
url = ""

Options:

Option Name Explanation Type Default
general.appid The application that the activity is set as. You are free to create your own, with customised fallback, play and pause icons. integer 1436573238636576891
general.cover-art Whether or not to display cover art. Please note that if this is true, art will be uploaded to litterbox anonymously. boolean true
general.show-time Whether or not to show the position that you are at and the length of the song. boolean true
general.log-level The level of logs that are sent to stdout. Acceptable levels are 30 WARN, 20 INFO, 10 DEBUG. integer 30
details.text The text to display in the details section of the activity. Templating is allowed. Leave as an empty string if unwanted. string ""
details.url The URL that clicking on the activity's details text will open. Leave as an empty string if unwanted. string ""
state.text The text to display in the state section of the activity, typically below the details. Templating is allowed. string "${song} / ${album} - ${artist}"
state.url The URL that clicking on the activity's state text will open. Leave as an empty string if unwanted. string ""
image.text The tooltip text shown when hovering over the large album art. Templating is allowed. string "Listening to ${song}"
image.url The URL that clicking on the large album art will open. Leave as an empty string if unwanted. string ""
buttons.*.text The text to display on the first button in the activity. A button will only appear if both its text and url attributes are filled. string ""
buttons.*.url The URL that clicking the button will open. A button will only appear if both its text and url attributes are filled. The url must be of format http://* or https://*. string ""

Templating

Templating allows strings to be dynamic dependent on the current song.

To use templating, wrap the desired field with curly brackets and prefix a $. e.g.${song}

There are 3 valid fields:

Field Explanation
${song} The title of the current song.
${artist} The artist of the current song
${album} The name of the album from the current song

License

g4music-discord-rpc is licensed under the MIT License. The full license can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g4music_discord_rpc-1.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

g4music_discord_rpc-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file g4music_discord_rpc-1.0.0.tar.gz.

File metadata

  • Download URL: g4music_discord_rpc-1.0.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for g4music_discord_rpc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a05e2f2be0d0445387e86393f8b46e11f1f88fdbae1c2a81e9ff577b8c698577
MD5 87a8fe289d762ba492836f03b0160458
BLAKE2b-256 2cb97d13e673e7d82744525c535a3cbf9fbbf21109ea0335409ea701b13f5cf7

See more details on using hashes here.

File details

Details for the file g4music_discord_rpc-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for g4music_discord_rpc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7b3a04c6819ec59e3ac655b641be9138bb742bd037310c1faeacec7019571fa
MD5 d01bb86f4b366a54a1442a38b03d6bb3
BLAKE2b-256 044c1db952b975b78e75421c5e3d337c1a27428004c87c346500b8a50fea9a19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page