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.1.tar.gz (6.7 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.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: g4music_discord_rpc-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 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.1.tar.gz
Algorithm Hash digest
SHA256 8e626b5b2281d5d17b700fa7d4f7ea7691d20afed7f3e10e4b09f751f604e096
MD5 a203ba409d0c01a105bff826275379c7
BLAKE2b-256 73b61d9fe7c233b80f85617a448b0c05cc8a208bc69a661d4430d90873c318d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for g4music_discord_rpc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c84612628a90ba3a5e06a64495fe480120a2bbdc59178b211d463c26dec3831
MD5 2e5cfe95e3005abf5960c4547960830d
BLAKE2b-256 ea9fda2a6e7de88f98b48e6b1e16aee52be892876e91c346a590628f6a2178b5

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