Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions assets/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@
"settings-smoothScroll-desc": "Toggle smooth scrolling",
"settings-autoScroll": "Allow auto-scroll",
"settings-autoScroll-desc": "Allow auto-scrolling with middle-click (Note: Your desktop environment can still override this with another action)",
"settings-quickCss": "Quick CSS",
"settings-quickCss-desc": "Quickly edit your CSS in a simple text editor. Changes are applied immediately after saving the file.",
"settings-category-lookAndFeel": "Look and feel",
"settings-category-mods": "Mods",
"settings-category-behaviour": "Behaviour",
Expand Down Expand Up @@ -235,6 +237,7 @@
"keybind-action": "Action",
"keybind-mute": "Mute",
"keybind-deafen": "Deafen",
"keybind-pushToTalk": "Push to talk",
"keybind-leaveCall": "Leave call",
"keybind-navigateForward": "Navigate forward",
"keybind-navigateBack": "Navigate back",
Expand Down Expand Up @@ -279,6 +282,13 @@
"games-removeConfirmBody": "This game will be removed from rich presence. The client must be restarted for changes to take effect.",
"games-noExecutables": "No executables",
"games-empty": "No registered games. Add one using the dropdown above.",
"games-lastDetected": "Last detected games",
"games-lastDetectedEmpty": "No games detected yet. Start a game with rich presence to see them here.",
"games-blacklist": "Blacklist",
"games-blacklisted": "Blacklisted games",
"games-blacklistedEmpty": "No blacklisted games.",
"games-removeFromBlacklist": "Remove from blacklist",
"games-application": "Application",
"screenshare-selectSource": "Please select a source",
"screenshare-venmicDisabled": "Venmic disabled",
"screenshare-share": "Share",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "legcord",
"version": "1.2.1",
"version": "1.2.2",
"description": "Legcord is a custom client designed to enhance your Discord experience while keeping everything lightweight.",
"main": "ts-out/main.js",
"engines": {
Expand All @@ -10,7 +10,7 @@
"build:dev": "rollup -c --environment BUILD:dev && tsx scripts/copyVenmic.mts",
"build:plugins": "lune ci --repoSubDir src/shelter --to ts-out/plugins",
"build": "pnpm build:plugins && rolldown -c rolldown.config.js && tsx scripts/copyVenmic.mts",
"start": "pnpm build:plugins && pnpm run build && electron --trace-warnings --ozone-platform-hint=auto ./ts-out/main.js",
"start": "pnpm run build && electron --trace-warnings --ozone-platform-hint=auto ./ts-out/main.js",
"startThemeManager": "pnpm run build:dev && electron ./ts-out/main.js themes",
"package": "pnpm run build && electron-builder",
"packageQuick": "pnpm run build && electron-builder --dir",
Expand All @@ -36,14 +36,14 @@
"@babel/preset-typescript": "^7.27.1",
"@biomejs/biome": "1.9.4",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-esm-shim": "^0.1.7",
"@types/minimatch": "^6.0.0",
"@types/node": "^22.10.1",
"@types/ws": "^8.5.13",
"@uwu/lune": "^1.6.2",
"@uwu/shelter-defs": "^1.5.1",
"babel-preset-solid": "^1.9.3",
"electron": "40.1.0",
"electron": "40.6.0",
"electron-builder": "26.0.20",
"lucide-solid": "^0.475.0",
"rolldown": "1.0.0-rc.2",
Expand Down
37 changes: 13 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions rolldown.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import babel from "@rollup/plugin-babel";
import esmShim from "@rollup/plugin-esm-shim";
import json from "@rollup/plugin-json";
import { defineConfig } from "rolldown";
import copy from "rollup-plugin-copy";

Expand Down Expand Up @@ -28,7 +27,6 @@ export default defineConfig([
],
plugins: [
esmShim(),
json(),
copy({
targets: [
{ src: "src/**/**/*.html", dest: "ts-out/html/" },
Expand All @@ -47,8 +45,8 @@ export default defineConfig([
format: "esm",
sourcemap: true,
},
external: [...electronExternals, "arrpc"],
plugins: [esmShim(), json()],
external: [...electronExternals, "arrpc", "node:worker_threads"],
plugins: [esmShim()],
},
{
input: "src/discord/preload/preload.mts",
Expand Down
1 change: 1 addition & 0 deletions src/@types/keybind.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type KeybindActions =
| "navigateBack"
| "navigateForward"
| "openQuickCss"
| "pushToTalk"
| "runJavascript";
export interface Keybind {
accelerator: Electron.Accelerator;
Expand Down
41 changes: 32 additions & 9 deletions src/@types/legcordWindow.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ export interface LegcordWindow {
edit: (id: string) => void;
folder: (id: string) => void;
importQuickCss: (css: string) => void;
disableQuickCss: () => void;
enableQuickCss: () => void;
};
rpc: {
listen: (
callback: (msg: {
activity: {
assets: { large_image: string | null; small_image: string | null };
application_id: number;
name: string;
};
}) => void,
) => void;
listen: (msg: {
activity: {
assets: { large_image: string | null; small_image: string | null };
application_id: number;
name: string;
};
}) => void;
getProcessList: () => ProcessInfo[];
refreshProcessList: () => void;
addDetectable: (e: Game) => void;
Expand All @@ -97,3 +97,26 @@ export interface LegcordWindow {
) => Promise<{ ok: true; data: string } | { ok: false; error: string }>;
};
}

export interface DetectedGame {
name: string;
id: number;
}

export interface LegcordRPC {
lastDetectedGames: DetectedGame[];
onLastDetectedUpdate: ((list: DetectedGame[]) => void) | null;
listen: (msg: {
activity: {
assets: { large_image: string | null; small_image: string | null };
application_id: number;
name: string;
};
}) => void;
}

declare global {
interface Window {
legcordRPC?: LegcordRPC;
}
}
3 changes: 3 additions & 0 deletions src/@types/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface Settings {
popoutPiP: boolean;
sleepInBackground: boolean;
useSystemCssEditor: boolean;
quickCss: boolean;
autoScroll: boolean;
additionalArguments: string;
noBundleUpdates: boolean;
Expand All @@ -71,4 +72,6 @@ export interface Settings {
scanInterval: number;
modCache?: Record<ValidMods, string>;
extendedPluginAbilities: boolean;
/** Application IDs to hide from Discord rich presence activity. */
rpcActivityBlacklist: number[];
}
3 changes: 3 additions & 0 deletions src/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ const defaults: Settings = {
autoScroll: false,
useSystemCssEditor: false,
extendedPluginAbilities: false,
quickCss: true,
rpcActivityBlacklist: [],
};

const safeMode: Settings = {
Expand All @@ -70,6 +72,7 @@ const safeMode: Settings = {
hardwareAcceleration: false,
disableHttpCache: true,
extendedPluginAbilities: false,
quickCss: false,
};

export function checkForDataFolder(): void {
Expand Down
16 changes: 16 additions & 0 deletions src/common/keybindActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export function runAction(keybind: Keybind) {
case "deafen":
deafenToggle();
break;
case "pushToTalk":
pushToTalk();
break;
case "leaveCall":
leaveCall();
break;
Expand Down Expand Up @@ -85,6 +88,19 @@ export function leaveCall() {
});
}

export function pushToTalk() {
console.log("[Keybind action] Push to talk");
mainWindows.forEach((window) => {
void window.webContents.executeJavaScript(`
window.shelter.flux.dispatcher.dispatch({
"type": "PUSH_TO_TALK_STATE_CHANGE",
"isActive": true,
"isPriority": false
})
`);
});
}

function navigateBack() {
mainWindows.forEach((window) => {
window.webContents.navigationHistory.goBack();
Expand Down
Loading
Loading