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:
- Pypi
python3 -m pip install g4music-discord-rpc
- 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
art-server-url = "https://litterbox.catbox.moe/resources/internals/api.php"
[art-server]
url = "https://litterbox.catbox.moe/resources/internals/api.php"
filename = "fileToUpload"
[art-server.data]
reqtype = "fileupload"
time = "1h"
[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 |
art-server.url |
A URL to an API that hosts images. The API must accept a POST request and return the URL of the uploaded image | string | "https://litterbox.catbox.moe/resources/internals/api.php" |
art-server.filename |
The filename to be uploaded to the server. | string | "fileToUpload" |
art-server.data |
Data to POST to the API. You may define any keys and values. | table | |
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file g4music_discord_rpc-1.0.2.tar.gz.
File metadata
- Download URL: g4music_discord_rpc-1.0.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
149ce73550e5e67dcda9d7948255bdb36a16a98a17f5a966ae83208a22c75183
|
|
| MD5 |
d2e5a0b19a81147a4b0ceb8fcdb197c6
|
|
| BLAKE2b-256 |
40597bdaf6a863b658a17106d4567d9702b7959d099c00e758eab9c6134e9fc6
|
File details
Details for the file g4music_discord_rpc-1.0.2-py3-none-any.whl.
File metadata
- Download URL: g4music_discord_rpc-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd53125379d647619d2a1bafec93d8d7e83f2fdfda7d281d0505b8bfae496b9a
|
|
| MD5 |
ebf55983a719e769dc6333914cf84ecf
|
|
| BLAKE2b-256 |
4d905801f8afec491d963e0040e9dca092684c7076e7b69d0d192914ed269945
|