Add option to disable the discord rpc idle text

This commit is contained in:
Autumn
2024-07-30 21:26:35 +10:00
parent 65f3b251f4
commit 2dd96dd48e
5 changed files with 25 additions and 0 deletions

View File

@@ -14,6 +14,10 @@ export let rpc: Client;
const observer = () => {
if (rpc) {
const showIdle = settingsStore.get<string, boolean>(settings.discord.showIdle) ?? true;
if (mediaInfo.status === MediaStatus.paused && !showIdle) {
rpc.clearActivity();
} else
rpc.setActivity(getActivity());
}
};
@@ -90,6 +94,10 @@ export const initRPC = () => {
rpc.login({ clientId }).then(
() => {
rpc.on("ready", () => {
const showIdle = settingsStore.get<string, boolean>(settings.discord.showIdle) ?? true;
if (mediaInfo.status === MediaStatus.paused && !showIdle) {
rpc.clearActivity();
} else
rpc.setActivity(getActivity());
});
ipcMain.on(globalEvents.updateInfo, observer);

View File

@@ -43,6 +43,7 @@ export const settingsStore = new Store({
enableDiscord: false,
discord: {
showSong: true,
showIdle: true,
idleText: "Browsing Tidal",
usingText: "Playing media on TIDAL",
includeTimestamps: true,