Merge branch 'main' into macos-standard-icons
This commit is contained in:
commit
6941758dcf
56 changed files with 336 additions and 169 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -20,5 +20,6 @@
|
||||||
},
|
},
|
||||||
"[jsonc]": {
|
"[jsonc]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
}
|
},
|
||||||
|
"cSpell.words": ["Vesktop"]
|
||||||
}
|
}
|
||||||
|
|
18
README.md
18
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Vencord Desktop
|
# Vesktop
|
||||||
|
|
||||||
Vencord Desktop is a cross platform desktop app aiming to give you a snappier Discord experience with Vencord pre-installed
|
Vesktop is a cross platform desktop app aiming to give you a snappier Discord experience with Vencord pre-installed
|
||||||
|
|
||||||
**Not yet supported**:
|
**Not yet supported**:
|
||||||
- Global Keybinds
|
- Global Keybinds
|
||||||
|
@ -13,11 +13,11 @@ Bug reports, feature requests & contributions are highly appreciated!!
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
Download and run Vencord-Desktop-Setup-VERSION.exe from [releases](https://github.com/Vencord/Desktop/releases/latest)
|
Download and run Vesktop-Setup-VERSION.exe from [releases](https://github.com/Vencord/Vesktop/releases/latest)
|
||||||
|
|
||||||
### Mac
|
### Mac
|
||||||
|
|
||||||
Download and run Vencord-Desktop-VERSION.dmg from [releases](https://github.com/Vencord/Desktop/releases/latest)
|
Download and run Vesktop-VERSION.dmg from [releases](https://github.com/Vencord/Vesktop/releases/latest)
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
|
@ -27,15 +27,15 @@ Install [vencord-desktop-git](https://aur.archlinux.org/packages/vencord-desktop
|
||||||
|
|
||||||
#### Ubuntu/Debian based
|
#### Ubuntu/Debian based
|
||||||
|
|
||||||
Download Vencord-Desktop-VERSION.deb from [releases](https://github.com/Vencord/Desktop/releases/latest)
|
Download Vesktop-VERSION.deb from [releases](https://github.com/Vencord/Vesktop/releases/latest)
|
||||||
|
|
||||||
#### Fedora/RHEL based
|
#### Fedora/RHEL based
|
||||||
|
|
||||||
Download Vencord-Desktop-VERSION.rpm from [releases](https://github.com/Vencord/Desktop/releases/latest)
|
Download Vesktop-VERSION.rpm from [releases](https://github.com/Vencord/Vesktop/releases/latest)
|
||||||
|
|
||||||
#### Other
|
#### Other
|
||||||
|
|
||||||
Either download Vencord-Desktop-VERSION.AppImage and just run it directly or grab Vencord-Desktop-VERSION.tar.gz, extract it somewhere and run `vencorddesktop`.
|
Either download Vesktop-VERSION.AppImage and just run it directly or grab Vesktop-VERSION.tar.gz, extract it somewhere and run `vencorddesktop`.
|
||||||
|
|
||||||
A flatpak is planned, if you want packages for other repos, feel free to create them and they can be linked as unofficial here
|
A flatpak is planned, if you want packages for other repos, feel free to create them and they can be linked as unofficial here
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ A flatpak is planned, if you want packages for other repos, feel free to create
|
||||||
Packaging will create builds in the dist/ folder. You can then install them like mentioned above or distribute them
|
Packaging will create builds in the dist/ folder. You can then install them like mentioned above or distribute them
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/Vencord/Desktop
|
git clone https://github.com/Vencord/Vesktop
|
||||||
cd Desktop
|
cd Vesktop
|
||||||
|
|
||||||
# Install Dependencies
|
# Install Dependencies
|
||||||
pnpm i
|
pnpm i
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "VencordDesktop",
|
"name": "VencordDesktop",
|
||||||
"version": "0.2.6",
|
"version": "0.2.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "",
|
"description": "",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "dev.vencord.desktop",
|
"appId": "dev.vencord.desktop",
|
||||||
"productName": "Vencord Desktop",
|
"productName": "Vesktop",
|
||||||
"files": [
|
"files": [
|
||||||
"!*",
|
"!*",
|
||||||
"dist/js",
|
"dist/js",
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
],
|
],
|
||||||
"linux": {
|
"linux": {
|
||||||
"category": "Network",
|
"category": "Network",
|
||||||
"maintainer": "vendicated+vencord-desktop@riseup.net",
|
"maintainer": "vendicated+vesktop@riseup.net",
|
||||||
"target": [
|
"target": [
|
||||||
"deb",
|
"deb",
|
||||||
"tar.gz",
|
"tar.gz",
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
"AppImage"
|
"AppImage"
|
||||||
],
|
],
|
||||||
"desktop": {
|
"desktop": {
|
||||||
"Name": "Vencord Desktop",
|
"Name": "Vesktop",
|
||||||
"GenericName": "Internet Messenger",
|
"GenericName": "Internet Messenger",
|
||||||
"Type": "Application",
|
"Type": "Application",
|
||||||
"Categories": "Network;InstantMessaging;Chat;",
|
"Categories": "Network;InstantMessaging;Chat;",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ await Promise.all([
|
||||||
}),
|
}),
|
||||||
createContext({
|
createContext({
|
||||||
...CommonOpts,
|
...CommonOpts,
|
||||||
globalName: "VencordDesktop",
|
globalName: "Vesktop",
|
||||||
entryPoints: ["src/renderer/index.ts"],
|
entryPoints: ["src/renderer/index.ts"],
|
||||||
outfile: "dist/js/renderer.js",
|
outfile: "dist/js/renderer.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
|
@ -65,7 +65,11 @@ await Promise.all([
|
||||||
tsconfig: "./scripts/build/tsconfig.esbuild.json",
|
tsconfig: "./scripts/build/tsconfig.esbuild.json",
|
||||||
external: ["@vencord/types/*"],
|
external: ["@vencord/types/*"],
|
||||||
plugins: [vencordDep],
|
plugins: [vencordDep],
|
||||||
footer: { js: "//# sourceURL=VCDRenderer" }
|
// TODO: remove legacy name once main Vencord codebase has migrated and some time has passed.
|
||||||
|
// this 0 is very important. we run this script via webFrame.executeJavaScript and the last
|
||||||
|
// expression will be the return value. Without the 0, the return value would be Vesktop which
|
||||||
|
// leads to "An object could not be cloned"
|
||||||
|
footer: { js: ";window.VencordDesktop=Vesktop;0 \n//# sourceURL=VCDRenderer" }
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
6
src/globals.d.ts
vendored
6
src/globals.d.ts
vendored
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
export var VencordDesktopNative: typeof import("preload/VencordDesktopNative").VencordDesktopNative;
|
export var VesktopNative: typeof import("preload/VesktopNative").VesktopNative;
|
||||||
export var VencordDesktop: typeof import("renderer/index");
|
export var Vesktop: typeof import("renderer/index");
|
||||||
export var VCDP: any;
|
export var VCDP: any;
|
||||||
|
|
||||||
export var IS_DEV: boolean;
|
export var IS_DEV: boolean;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ export async function initArRPC() {
|
||||||
mainWin.webContents
|
mainWin.webContents
|
||||||
// Safety: Result of JSON.stringify should always be safe to equal
|
// Safety: Result of JSON.stringify should always be safe to equal
|
||||||
// Also, just to be super super safe, invite is regex validated above
|
// Also, just to be super super safe, invite is regex validated above
|
||||||
.executeJavaScript(`VencordDesktop.openInviteModal(${JSON.stringify(invite)})`)
|
.executeJavaScript(`Vesktop.openInviteModal(${JSON.stringify(invite)})`)
|
||||||
.then(callback);
|
.then(callback);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ export const VENCORD_SETTINGS_FILE = join(VENCORD_SETTINGS_DIR, "settings.json")
|
||||||
export const VENCORD_FILES_DIR =
|
export const VENCORD_FILES_DIR =
|
||||||
(require("./settings") as typeof import("./settings")).Settings.store.vencordDir || join(DATA_DIR, "vencordDist");
|
(require("./settings") as typeof import("./settings")).Settings.store.vencordDir || join(DATA_DIR, "vencordDist");
|
||||||
|
|
||||||
export const USER_AGENT = `VencordDesktop/${app.getVersion()} (https://github.com/Vencord/Desktop)`;
|
export const USER_AGENT = `Vesktop/${app.getVersion()} (https://github.com/Vencord/Vesktop)`;
|
||||||
|
|
||||||
// dimensions shamelessly stolen from Discord Desktop :3
|
// dimensions shamelessly stolen from Discord Desktop :3
|
||||||
export const MIN_WIDTH = 940;
|
export const MIN_WIDTH = 940;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -59,10 +59,10 @@ function init() {
|
||||||
|
|
||||||
if (!app.requestSingleInstanceLock({ IS_DEV })) {
|
if (!app.requestSingleInstanceLock({ IS_DEV })) {
|
||||||
if (IS_DEV) {
|
if (IS_DEV) {
|
||||||
console.log("Vencord Desktop is already running. Quitting previous instance...");
|
console.log("Vesktop is already running. Quitting previous instance...");
|
||||||
init();
|
init();
|
||||||
} else {
|
} else {
|
||||||
console.log("Vencord Desktop is already running. Quitting...");
|
console.log("Vesktop is already running. Quitting...");
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { app, dialog, ipcMain, session, shell } from "electron";
|
import { app, dialog, ipcMain, session, shell } from "electron";
|
||||||
import { existsSync, readFileSync, watch } from "fs";
|
import { existsSync, readFileSync, watch } from "fs";
|
||||||
import { open, readFile } from "fs/promises";
|
import { open, readFile } from "fs/promises";
|
||||||
|
import { release } from "os";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { debounce } from "shared/utils/debounce";
|
import { debounce } from "shared/utils/debounce";
|
||||||
|
|
||||||
|
@ -41,6 +42,10 @@ ipcMain.on(IpcEvents.GET_VERSION, e => {
|
||||||
e.returnValue = app.getVersion();
|
e.returnValue = app.getVersion();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.on(IpcEvents.SUPPORTS_WINDOWS_TRANSPARENCY, e => {
|
||||||
|
e.returnValue = process.platform === "win32" && Number(release().split(".").pop()) >= 22621;
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain.on(IpcEvents.AUTOSTART_ENABLED, e => {
|
ipcMain.on(IpcEvents.AUTOSTART_ENABLED, e => {
|
||||||
e.returnValue = autoStart.isEnabled();
|
e.returnValue = autoStart.isEnabled();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,19 +1,29 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { app, BrowserWindow, BrowserWindowConstructorOptions, Menu, Tray } from "electron";
|
import {
|
||||||
|
app,
|
||||||
|
BrowserWindow,
|
||||||
|
BrowserWindowConstructorOptions,
|
||||||
|
dialog,
|
||||||
|
Menu,
|
||||||
|
MenuItemConstructorOptions,
|
||||||
|
Tray
|
||||||
|
} from "electron";
|
||||||
|
import { rm } from "fs/promises";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { IpcEvents } from "shared/IpcEvents";
|
import { IpcEvents } from "shared/IpcEvents";
|
||||||
|
import { isTruthy } from "shared/utils/guards";
|
||||||
import { once } from "shared/utils/once";
|
import { once } from "shared/utils/once";
|
||||||
import type { SettingsStore } from "shared/utils/SettingsStore";
|
import type { SettingsStore } from "shared/utils/SettingsStore";
|
||||||
|
|
||||||
import { ICON_PATH } from "../shared/paths";
|
import { ICON_PATH } from "../shared/paths";
|
||||||
import { createAboutWindow } from "./about";
|
import { createAboutWindow } from "./about";
|
||||||
import { initArRPC } from "./arrpc";
|
import { initArRPC } from "./arrpc";
|
||||||
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, MIN_HEIGHT, MIN_WIDTH, VENCORD_FILES_DIR } from "./constants";
|
import { DATA_DIR, DEFAULT_HEIGHT, DEFAULT_WIDTH, MIN_HEIGHT, MIN_WIDTH, VENCORD_FILES_DIR } from "./constants";
|
||||||
import { Settings, VencordSettings } from "./settings";
|
import { Settings, VencordSettings } from "./settings";
|
||||||
import { createSplashWindow } from "./splash";
|
import { createSplashWindow } from "./splash";
|
||||||
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
|
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
|
||||||
|
@ -70,6 +80,12 @@ function initTray(win: BrowserWindow) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Reset Vesktop",
|
||||||
|
async click() {
|
||||||
|
await clearData(win);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: "separator"
|
type: "separator"
|
||||||
},
|
},
|
||||||
|
@ -81,7 +97,7 @@ function initTray(win: BrowserWindow) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Quit Vencord Desktop",
|
label: "Quit Vesktop",
|
||||||
click() {
|
click() {
|
||||||
isQuitting = true;
|
isQuitting = true;
|
||||||
app.quit();
|
app.quit();
|
||||||
|
@ -90,7 +106,7 @@ function initTray(win: BrowserWindow) {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
tray = new Tray(ICON_PATH);
|
tray = new Tray(ICON_PATH);
|
||||||
tray.setToolTip("Vencord Desktop");
|
tray.setToolTip("Vesktop");
|
||||||
tray.setContextMenu(trayMenu);
|
tray.setContextMenu(trayMenu);
|
||||||
tray.on("click", () => win.show());
|
tray.on("click", () => win.show());
|
||||||
|
|
||||||
|
@ -103,62 +119,107 @@ function initTray(win: BrowserWindow) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const enum MessageBoxChoice {
|
||||||
|
Default,
|
||||||
|
Cancel
|
||||||
|
}
|
||||||
|
|
||||||
|
async function clearData(win: BrowserWindow) {
|
||||||
|
const { response } = await dialog.showMessageBox(win, {
|
||||||
|
message: "Are you sure you want to reset Vesktop?",
|
||||||
|
detail: "This will log you out, clear caches and reset all your settings!\n\nVesktop will automatically restart after this operation.",
|
||||||
|
buttons: ["Yes", "No"],
|
||||||
|
cancelId: MessageBoxChoice.Cancel,
|
||||||
|
defaultId: MessageBoxChoice.Default,
|
||||||
|
type: "warning"
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response === MessageBoxChoice.Cancel) return;
|
||||||
|
|
||||||
|
win.close();
|
||||||
|
|
||||||
|
await win.webContents.session.clearStorageData();
|
||||||
|
await win.webContents.session.clearCache();
|
||||||
|
await win.webContents.session.clearCodeCaches({});
|
||||||
|
await rm(DATA_DIR, { force: true, recursive: true });
|
||||||
|
|
||||||
|
app.relaunch();
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
|
||||||
function initMenuBar(win: BrowserWindow) {
|
function initMenuBar(win: BrowserWindow) {
|
||||||
const isWindows = process.platform === "win32";
|
const isWindows = process.platform === "win32";
|
||||||
|
const isDarwin = process.platform === "darwin";
|
||||||
const wantCtrlQ = !isWindows || VencordSettings.store.winCtrlQ;
|
const wantCtrlQ = !isWindows || VencordSettings.store.winCtrlQ;
|
||||||
|
|
||||||
|
const subMenu = [
|
||||||
|
{
|
||||||
|
label: "About Vesktop",
|
||||||
|
click: createAboutWindow
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Force Update Vencord",
|
||||||
|
async click() {
|
||||||
|
await downloadVencordFiles();
|
||||||
|
app.relaunch();
|
||||||
|
app.quit();
|
||||||
|
},
|
||||||
|
toolTip: "Vesktop will automatically restart after this operation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Reset Vesktop",
|
||||||
|
async click() {
|
||||||
|
await clearData(win);
|
||||||
|
},
|
||||||
|
toolTip: "Vesktop will automatically restart after this operation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Relaunch",
|
||||||
|
accelerator: "CmdOrCtrl+Shift+R",
|
||||||
|
click() {
|
||||||
|
app.relaunch();
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isDarwin && {
|
||||||
|
label: "Hide",
|
||||||
|
role: "hide"
|
||||||
|
},
|
||||||
|
isDarwin && {
|
||||||
|
label: "Hide others",
|
||||||
|
role: "hideOthers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Quit",
|
||||||
|
accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0,
|
||||||
|
visible: !isWindows,
|
||||||
|
role: "quit",
|
||||||
|
click() {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isWindows && {
|
||||||
|
label: "Quit",
|
||||||
|
accelerator: "Alt+F4",
|
||||||
|
role: "quit",
|
||||||
|
click() {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// See https://github.com/electron/electron/issues/14742 and https://github.com/electron/electron/issues/5256
|
||||||
|
{
|
||||||
|
label: "Zoom in (hidden, hack for Qwertz and others)",
|
||||||
|
accelerator: "CmdOrCtrl+=",
|
||||||
|
role: "zoomIn",
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
] satisfies Array<MenuItemConstructorOptions | false>;
|
||||||
|
|
||||||
const menu = Menu.buildFromTemplate([
|
const menu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
label: "Vencord Desktop",
|
label: "Vesktop",
|
||||||
role: "appMenu",
|
role: "appMenu",
|
||||||
submenu: [
|
submenu: subMenu.filter(isTruthy)
|
||||||
{
|
|
||||||
label: "About Vencord Desktop",
|
|
||||||
click: createAboutWindow
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Force Update Vencord",
|
|
||||||
async click() {
|
|
||||||
await downloadVencordFiles();
|
|
||||||
app.relaunch();
|
|
||||||
app.quit();
|
|
||||||
},
|
|
||||||
toolTip: "Vencord Desktop will automatically restart after this operation"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Relaunch",
|
|
||||||
accelerator: "CmdOrCtrl+Shift+R",
|
|
||||||
click() {
|
|
||||||
app.relaunch();
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Quit",
|
|
||||||
accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0,
|
|
||||||
visible: !isWindows,
|
|
||||||
role: "quit",
|
|
||||||
click() {
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Quit",
|
|
||||||
accelerator: isWindows ? "Alt+F4" : void 0,
|
|
||||||
visible: isWindows,
|
|
||||||
role: "quit",
|
|
||||||
click() {
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// See https://github.com/electron/electron/issues/14742 and https://github.com/electron/electron/issues/5256
|
|
||||||
{
|
|
||||||
label: "Zoom in (hidden, hack for Qwertz and others)",
|
|
||||||
accelerator: "CmdOrCtrl+=",
|
|
||||||
role: "zoomIn",
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{ role: "fileMenu" },
|
{ role: "fileMenu" },
|
||||||
{ role: "editMenu" },
|
{ role: "editMenu" },
|
||||||
|
@ -250,6 +311,8 @@ function createMainWindow() {
|
||||||
removeSettingsListeners();
|
removeSettingsListeners();
|
||||||
removeVencordSettingsListeners();
|
removeVencordSettingsListeners();
|
||||||
|
|
||||||
|
const { staticTitle, transparencyOption } = Settings.store;
|
||||||
|
const { frameless, macosTranslucency } = VencordSettings.store;
|
||||||
const win = (mainWin = new BrowserWindow({
|
const win = (mainWin = new BrowserWindow({
|
||||||
show: false,
|
show: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
@ -261,23 +324,34 @@ function createMainWindow() {
|
||||||
spellcheck: true
|
spellcheck: true
|
||||||
},
|
},
|
||||||
icon: ICON_PATH,
|
icon: ICON_PATH,
|
||||||
frame: VencordSettings.store.frameless !== true,
|
frame: frameless !== true,
|
||||||
...(Settings.store.staticTitle ? { title: "Vencord" } : {}),
|
...(transparencyOption && transparencyOption !== "none"
|
||||||
...(VencordSettings.store.macosTranslucency
|
? {
|
||||||
|
backgroundColor: "#00000000",
|
||||||
|
backgroundMaterial: Settings.store.transparencyOption,
|
||||||
|
transparent: true
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
|
...(staticTitle ? { title: "Vencord" } : {}),
|
||||||
|
...(macosTranslucency
|
||||||
? {
|
? {
|
||||||
vibrancy: "sidebar",
|
vibrancy: "sidebar",
|
||||||
backgroundColor: "#ffffff00"
|
backgroundColor: "#ffffff00"
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
...(process.platform === "darwin" ? { titleBarStyle: "hiddenInset" } : {}),
|
||||||
...getWindowBoundsOptions()
|
...getWindowBoundsOptions()
|
||||||
}));
|
}));
|
||||||
win.setMenuBarVisibility(false);
|
win.setMenuBarVisibility(false);
|
||||||
|
|
||||||
win.on("close", e => {
|
win.on("close", e => {
|
||||||
if (isQuitting || Settings.store.minimizeToTray === false || Settings.store.tray === false) return;
|
const useTray = Settings.store.minimizeToTray !== false && Settings.store.tray !== false;
|
||||||
|
if (isQuitting || (process.platform !== "darwin" && !useTray)) return;
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
win.hide();
|
|
||||||
|
if (process.platform === "darwin") app.hide();
|
||||||
|
else win.hide();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -285,7 +359,7 @@ function createMainWindow() {
|
||||||
if (Settings.store.staticTitle) win.on("page-title-updated", e => e.preventDefault());
|
if (Settings.store.staticTitle) win.on("page-title-updated", e => e.preventDefault());
|
||||||
|
|
||||||
initWindowBoundsListeners(win);
|
initWindowBoundsListeners(win);
|
||||||
if (Settings.store.tray ?? true) initTray(win);
|
if ((Settings.store.tray ?? true) && process.platform !== "darwin") initTray(win);
|
||||||
initMenuBar(win);
|
initMenuBar(win);
|
||||||
makeLinksOpenExternally(win);
|
makeLinksOpenExternally(win);
|
||||||
initSettingsListeners(win);
|
initSettingsListeners(win);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ export function registerScreenShareHandler() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const choice = await request.frame
|
const choice = await request.frame
|
||||||
.executeJavaScript(`VencordDesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
|
.executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
|
||||||
.then(e => e as StreamPick)
|
.then(e => e as StreamPick)
|
||||||
.catch(() => null);
|
.catch(() => null);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -33,5 +33,5 @@ function loadSettings<T extends object = any>(file: string, name: string) {
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Settings = loadSettings<TSettings>(SETTINGS_FILE, "Vencord Desktop");
|
export const Settings = loadSettings<TSettings>(SETTINGS_FILE, "Vesktop");
|
||||||
export const VencordSettings = loadSettings<any>(VENCORD_SETTINGS_FILE, "Vencord");
|
export const VencordSettings = loadSettings<any>(VENCORD_SETTINGS_FILE, "Vencord");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -19,11 +19,12 @@ ipcRenderer.on(IpcEvents.SPELLCHECK_RESULT, (_, w: string, s: string[]) => {
|
||||||
spellCheckCallbacks.forEach(cb => cb(w, s));
|
spellCheckCallbacks.forEach(cb => cb(w, s));
|
||||||
});
|
});
|
||||||
|
|
||||||
export const VencordDesktopNative = {
|
export const VesktopNative = {
|
||||||
app: {
|
app: {
|
||||||
relaunch: () => invoke<void>(IpcEvents.RELAUNCH),
|
relaunch: () => invoke<void>(IpcEvents.RELAUNCH),
|
||||||
getVersion: () => sendSync<void>(IpcEvents.GET_VERSION),
|
getVersion: () => sendSync<void>(IpcEvents.GET_VERSION),
|
||||||
setBadgeCount: (count: number) => invoke<void>(IpcEvents.SET_BADGE_COUNT, count)
|
setBadgeCount: (count: number) => invoke<void>(IpcEvents.SET_BADGE_COUNT, count),
|
||||||
|
supportsWindowsTransparency: () => sendSync<boolean>(IpcEvents.SUPPORTS_WINDOWS_TRANSPARENCY)
|
||||||
},
|
},
|
||||||
autostart: {
|
autostart: {
|
||||||
isEnabled: () => sendSync<boolean>(IpcEvents.AUTOSTART_ENABLED),
|
isEnabled: () => sendSync<boolean>(IpcEvents.AUTOSTART_ENABLED),
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -8,9 +8,11 @@ import { contextBridge, ipcRenderer, webFrame } from "electron";
|
||||||
import { readFileSync, watch } from "fs";
|
import { readFileSync, watch } from "fs";
|
||||||
|
|
||||||
import { IpcEvents } from "../shared/IpcEvents";
|
import { IpcEvents } from "../shared/IpcEvents";
|
||||||
import { VencordDesktopNative } from "./VencordDesktopNative";
|
import { VesktopNative } from "./VesktopNative";
|
||||||
|
|
||||||
contextBridge.exposeInMainWorld("VencordDesktopNative", VencordDesktopNative);
|
contextBridge.exposeInMainWorld("VesktopNative", VesktopNative);
|
||||||
|
// TODO: remove legacy alias once main Vencord codebase has migrated and some time has passed
|
||||||
|
contextBridge.exposeInMainWorld("VencordDesktopNative", VesktopNative);
|
||||||
|
|
||||||
require(ipcRenderer.sendSync(IpcEvents.GET_VENCORD_PRELOAD_FILE));
|
require(ipcRenderer.sendSync(IpcEvents.GET_VENCORD_PRELOAD_FILE));
|
||||||
|
|
||||||
|
@ -41,4 +43,4 @@ if (IS_DEV) {
|
||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
VencordDesktopNative.spellcheck.setLanguages(window.navigator.languages);
|
VesktopNative.spellcheck.setLanguages(window.navigator.languages);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export function setBadge() {
|
||||||
let totalCount = mentionCount + pendingRequests;
|
let totalCount = mentionCount + pendingRequests;
|
||||||
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;
|
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;
|
||||||
|
|
||||||
VencordDesktopNative.app.setBadgeCount(totalCount);
|
VesktopNative.app.setBadgeCount(totalCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
let toFind = 3;
|
let toFind = 3;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ function StreamSettings({
|
||||||
settings: StreamSettings;
|
settings: StreamSettings;
|
||||||
setSettings: Dispatch<SetStateAction<StreamSettings>>;
|
setSettings: Dispatch<SetStateAction<StreamSettings>>;
|
||||||
}) {
|
}) {
|
||||||
const [thumb] = useAwaiter(() => VencordDesktopNative.capturer.getLargeThumbnail(source.id), {
|
const [thumb] = useAwaiter(() => VesktopNative.capturer.getLargeThumbnail(source.id), {
|
||||||
fallbackValue: source.url,
|
fallbackValue: source.url,
|
||||||
deps: [source.id]
|
deps: [source.id]
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -13,16 +13,17 @@ import { useSettings } from "renderer/settings";
|
||||||
|
|
||||||
export default function SettingsUi() {
|
export default function SettingsUi() {
|
||||||
const Settings = useSettings();
|
const Settings = useSettings();
|
||||||
|
const supportsWindowsTransparency = VesktopNative.app.supportsWindowsTransparency();
|
||||||
|
|
||||||
const { autostart } = VencordDesktopNative;
|
const { autostart } = VesktopNative;
|
||||||
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
||||||
|
|
||||||
const switches: [keyof typeof Settings, string, string, boolean?, (() => boolean)?][] = [
|
const switches: [keyof typeof Settings, string, string, boolean?, (() => boolean)?][] = [
|
||||||
["tray", "Tray Icon", "Add a tray icon for Vencord Desktop", true],
|
["tray", "Tray Icon", "Add a tray icon for Vesktop", true],
|
||||||
[
|
[
|
||||||
"minimizeToTray",
|
"minimizeToTray",
|
||||||
"Minimize to tray",
|
"Minimize to tray",
|
||||||
"Hitting X will make Vencord Desktop minimize to the tray instead of closing",
|
"Hitting X will make Vesktop minimize to the tray instead of closing",
|
||||||
true,
|
true,
|
||||||
() => Settings.tray ?? true
|
() => Settings.tray ?? true
|
||||||
],
|
],
|
||||||
|
@ -35,7 +36,7 @@ export default function SettingsUi() {
|
||||||
[
|
[
|
||||||
"openLinksWithElectron",
|
"openLinksWithElectron",
|
||||||
"Open Links in app (experimental)",
|
"Open Links in app (experimental)",
|
||||||
"Opens links in a new Vencord Desktop window instead of your web browser"
|
"Opens links in a new Vesktop window instead of your web browser"
|
||||||
],
|
],
|
||||||
["staticTitle", "Static Title", 'Makes the window title "Vencord" instead of changing to the current page']
|
["staticTitle", "Static Title", 'Makes the window title "Vencord" instead of changing to the current page']
|
||||||
];
|
];
|
||||||
|
@ -43,10 +44,10 @@ export default function SettingsUi() {
|
||||||
return (
|
return (
|
||||||
<Forms.FormSection>
|
<Forms.FormSection>
|
||||||
<Text variant="heading-lg/semibold" style={{ color: "var(--header-primary)" }} tag="h2">
|
<Text variant="heading-lg/semibold" style={{ color: "var(--header-primary)" }} tag="h2">
|
||||||
Vencord Desktop Settings
|
Vesktop Settings
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Forms.FormTitle className={Margins.top16}>Discord Branch</Forms.FormTitle>
|
<Forms.FormTitle className={Margins.top16 + " " + Margins.bottom8}>Discord Branch</Forms.FormTitle>
|
||||||
<Select
|
<Select
|
||||||
placeholder="Stable"
|
placeholder="Stable"
|
||||||
options={[
|
options={[
|
||||||
|
@ -68,7 +69,7 @@ export default function SettingsUi() {
|
||||||
await autostart[v ? "enable" : "disable"]();
|
await autostart[v ? "enable" : "disable"]();
|
||||||
setAutoStartEnabled(v);
|
setAutoStartEnabled(v);
|
||||||
}}
|
}}
|
||||||
note="Automatically start Vencord Desktop on computer start-up"
|
note="Automatically start Vesktop on computer start-up"
|
||||||
>
|
>
|
||||||
Start With System
|
Start With System
|
||||||
</Switch>
|
</Switch>
|
||||||
|
@ -78,7 +79,7 @@ export default function SettingsUi() {
|
||||||
onChange={v => {
|
onChange={v => {
|
||||||
Settings.appBadge = v;
|
Settings.appBadge = v;
|
||||||
if (v) setBadge();
|
if (v) setBadge();
|
||||||
else VencordDesktopNative.app.setBadgeCount(0);
|
else VesktopNative.app.setBadgeCount(0);
|
||||||
}}
|
}}
|
||||||
note="Show mention badge on the app icon"
|
note="Show mention badge on the app icon"
|
||||||
>
|
>
|
||||||
|
@ -97,6 +98,43 @@ export default function SettingsUi() {
|
||||||
</Switch>
|
</Switch>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
{supportsWindowsTransparency && (
|
||||||
|
<>
|
||||||
|
<Forms.FormTitle className={Margins.top16 + " " + Margins.bottom8}>
|
||||||
|
Transparency Options
|
||||||
|
</Forms.FormTitle>
|
||||||
|
<Forms.FormText className={Margins.bottom8}>
|
||||||
|
Requires a full restart. You will need a theme that supports transparency for this to work.
|
||||||
|
</Forms.FormText>
|
||||||
|
|
||||||
|
<Select
|
||||||
|
placeholder="None"
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
label: "None",
|
||||||
|
value: "none",
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Mica (incorporates system theme + desktop wallpaper to paint the background)",
|
||||||
|
value: "mica"
|
||||||
|
},
|
||||||
|
{ label: "Tabbed (variant of Mica with stronger background tinting)", value: "tabbed" },
|
||||||
|
{
|
||||||
|
label: "Acrylic (blurs the window behind Vesktop for a translucent background)",
|
||||||
|
value: "acrylic"
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
closeOnSelect={true}
|
||||||
|
select={v => (Settings.transparencyOption = v)}
|
||||||
|
isSelected={v => v === Settings.transparencyOption}
|
||||||
|
serialize={s => s}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Forms.FormDivider className={Margins.top16 + " " + Margins.bottom16} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<Forms.FormTitle>Vencord Location</Forms.FormTitle>
|
<Forms.FormTitle>Vencord Location</Forms.FormTitle>
|
||||||
<Forms.FormText>
|
<Forms.FormText>
|
||||||
Vencord files are loaded from{" "}
|
Vencord files are loaded from{" "}
|
||||||
|
@ -105,7 +143,7 @@ export default function SettingsUi() {
|
||||||
href="about:blank"
|
href="about:blank"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
VencordDesktopNative.fileManager.showItemInFolder(Settings.vencordDir!);
|
VesktopNative.fileManager.showItemInFolder(Settings.vencordDir!);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{Settings.vencordDir}
|
{Settings.vencordDir}
|
||||||
|
@ -118,7 +156,7 @@ export default function SettingsUi() {
|
||||||
<Button
|
<Button
|
||||||
size={Button.Sizes.SMALL}
|
size={Button.Sizes.SMALL}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const choice = await VencordDesktopNative.fileManager.selectVencordDir();
|
const choice = await VesktopNative.fileManager.selectVencordDir();
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case "cancelled":
|
case "cancelled":
|
||||||
case "invalid":
|
case "invalid":
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ Object.defineProperty(Notification.prototype, "onclick", {
|
||||||
set(onClick) {
|
set(onClick) {
|
||||||
originalSetOnClick.call(this, function (this: unknown) {
|
originalSetOnClick.call(this, function (this: unknown) {
|
||||||
onClick.apply(this, arguments);
|
onClick.apply(this, arguments);
|
||||||
VencordDesktopNative.win.focus();
|
VesktopNative.win.focus();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
configurable: true
|
configurable: true
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export async function openInviteModal(code: string) {
|
||||||
const { invite } = await InviteActions.resolveInvite(code, "Desktop Modal");
|
const { invite } = await InviteActions.resolveInvite(code, "Desktop Modal");
|
||||||
if (!invite) return false;
|
if (!invite) return false;
|
||||||
|
|
||||||
VencordDesktopNative.win.focus();
|
VesktopNative.win.focus();
|
||||||
|
|
||||||
FluxDispatcher.dispatch({
|
FluxDispatcher.dispatch({
|
||||||
type: "INVITE_MODAL_OPEN",
|
type: "INVITE_MODAL_OPEN",
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO: Possibly auto generate glob if we have more patches in the future
|
// TODO: Possibly auto generate glob if we have more patches in the future
|
||||||
import "./spellCheck";
|
import "./spellCheck";
|
||||||
|
import "./platformClass";
|
||||||
|
|
22
src/renderer/patches/platformClass.tsx
Normal file
22
src/renderer/patches/platformClass.tsx
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { addPatch } from "./shared";
|
||||||
|
|
||||||
|
addPatch({
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: "platform-web",
|
||||||
|
replacement: {
|
||||||
|
// eslint-disable-next-line no-useless-escape
|
||||||
|
match: /(?<=" platform-overlay"\):)\i/,
|
||||||
|
replace: "$self.getPlatformClass()"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
getPlatformClass: () => (navigator.platform.toLowerCase().startsWith("mac") ? "platform-osx" : "platform-web")
|
||||||
|
});
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export function addPatch<P extends PatchData>(p: P) {
|
||||||
if (typeof r.replace === "string") r.replace = r.replace.replaceAll("$self", "VCDP");
|
if (typeof r.replace === "string") r.replace = r.replace.replaceAll("$self", "VCDP");
|
||||||
}
|
}
|
||||||
|
|
||||||
patch.plugin = "VencordDesktop";
|
patch.plugin = "Vesktop";
|
||||||
Vencord.Plugins.patches.push(patch);
|
Vencord.Plugins.patches.push(patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -37,12 +37,12 @@ addPatch({
|
||||||
}
|
}
|
||||||
|
|
||||||
const cb = (w: string, c: string[]) => {
|
const cb = (w: string, c: string[]) => {
|
||||||
VencordDesktopNative.spellcheck.offSpellcheckResult(cb);
|
VesktopNative.spellcheck.offSpellcheckResult(cb);
|
||||||
word = w;
|
word = w;
|
||||||
corrections = c;
|
corrections = c;
|
||||||
openMenu();
|
openMenu();
|
||||||
};
|
};
|
||||||
VencordDesktopNative.spellcheck.onSpellcheckResult(cb);
|
VesktopNative.spellcheck.onSpellcheckResult(cb);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -57,14 +57,14 @@ addContextMenuPatch("textarea-context", children => () => {
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id={"vcd-spellcheck-suggestion-" + c}
|
id={"vcd-spellcheck-suggestion-" + c}
|
||||||
label={c}
|
label={c}
|
||||||
action={() => VencordDesktopNative.spellcheck.replaceMisspelling(c)}
|
action={() => VesktopNative.spellcheck.replaceMisspelling(c)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<Menu.MenuSeparator />
|
<Menu.MenuSeparator />
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
id="vcd-spellcheck-learn"
|
id="vcd-spellcheck-learn"
|
||||||
label={`Add ${word} to dictionary`}
|
label={`Add ${word} to dictionary`}
|
||||||
action={() => VencordDesktopNative.spellcheck.addToDictionary(word)}
|
action={() => VesktopNative.spellcheck.addToDictionary(word)}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useEffect, useReducer } from "@vencord/types/webpack/common";
|
import { useEffect, useReducer } from "@vencord/types/webpack/common";
|
||||||
import { SettingsStore } from "shared/utils/SettingsStore";
|
import { SettingsStore } from "shared/utils/SettingsStore";
|
||||||
|
|
||||||
export const Settings = new SettingsStore(VencordDesktopNative.settings.get());
|
export const Settings = new SettingsStore(VesktopNative.settings.get());
|
||||||
Settings.addGlobalChangeListener((o, p) => VencordDesktopNative.settings.set(o, p));
|
Settings.addGlobalChangeListener((o, p) => VesktopNative.settings.set(o, p));
|
||||||
|
|
||||||
export function useSettings() {
|
export function useSettings() {
|
||||||
const [, update] = useReducer(x => x + 1, 0);
|
const [, update] = useReducer(x => x + 1, 0);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ export const enum IpcEvents {
|
||||||
GET_RENDERER_CSS_FILE = "VCD_GET_RENDERER_CSS_FILE",
|
GET_RENDERER_CSS_FILE = "VCD_GET_RENDERER_CSS_FILE",
|
||||||
|
|
||||||
GET_VERSION = "VCD_GET_VERSION",
|
GET_VERSION = "VCD_GET_VERSION",
|
||||||
|
SUPPORTS_WINDOWS_TRANSPARENCY = "VCD_SUPPORTS_WINDOWS_TRANSPARENCY",
|
||||||
|
|
||||||
RELAUNCH = "VCD_RELAUNCH",
|
RELAUNCH = "VCD_RELAUNCH",
|
||||||
CLOSE = "VCD_CLOSE",
|
CLOSE = "VCD_CLOSE",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
3
src/shared/settings.d.ts
vendored
3
src/shared/settings.d.ts
vendored
|
@ -1,12 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { Rectangle } from "electron";
|
import type { Rectangle } from "electron";
|
||||||
|
|
||||||
export interface Settings {
|
export interface Settings {
|
||||||
|
transparencyOption?: "none" | "mica" | "tabbed" | "acrylic";
|
||||||
maximized?: boolean;
|
maximized?: boolean;
|
||||||
minimized?: boolean;
|
minimized?: boolean;
|
||||||
windowBounds?: Rectangle;
|
windowBounds?: Rectangle;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
13
src/shared/utils/guards.ts
Normal file
13
src/shared/utils/guards.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function isTruthy<T>(item: T): item is Exclude<T, 0 | "" | false | null | undefined> {
|
||||||
|
return Boolean(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNonNullish<T>(item: T): item is Exclude<T, null | undefined> {
|
||||||
|
return item != null;
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -35,7 +35,11 @@ ipcMain.handle(IpcEvents.UPDATER_DOWNLOAD, () => {
|
||||||
return portable ? !isSetup : isSetup;
|
return portable ? !isSetup : isSetup;
|
||||||
})!.browser_download_url;
|
})!.browser_download_url;
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return assets.find(a => a.name.endsWith(".dmg"))!.browser_download_url;
|
return assets.find(a =>
|
||||||
|
process.arch === "arm64"
|
||||||
|
? a.name.endsWith("-arm64-mac.zip")
|
||||||
|
: a.name.endsWith("-mac.zip") && !a.name.includes("arm64")
|
||||||
|
)!.browser_download_url;
|
||||||
case "linux":
|
case "linux":
|
||||||
return updateData.release.html_url;
|
return updateData.release.html_url;
|
||||||
default:
|
default:
|
||||||
|
@ -74,7 +78,7 @@ function isOutdated(oldVersion: string, newVersion: string) {
|
||||||
export async function checkUpdates() {
|
export async function checkUpdates() {
|
||||||
// if (IS_DEV) return;
|
// if (IS_DEV) return;
|
||||||
try {
|
try {
|
||||||
const raw = await githubGet("/repos/Vencord/Desktop/releases/latest");
|
const raw = await githubGet("/repos/Vencord/Vesktop/releases/latest");
|
||||||
const data = JSON.parse(raw.toString("utf-8")) as ReleaseData;
|
const data = JSON.parse(raw.toString("utf-8")) as ReleaseData;
|
||||||
|
|
||||||
const oldVersion = app.getVersion();
|
const oldVersion = app.getVersion();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: GPL-3.0
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1 id="title">Vencord Desktop</h1>
|
<h1 id="title">Vesktop</h1>
|
||||||
<p>
|
<p>
|
||||||
Vencord Desktop is a free/libre cross platform desktop app aiming to give you a snappier Discord experience with
|
Vesktop is a free/libre cross platform desktop app aiming to give you a snappier Discord experience with Vencord
|
||||||
Vencord pre-installed
|
pre-installed
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
@ -26,17 +26,17 @@
|
||||||
<a href="https://vencord.dev" target="_blank">Vencord Website</a>
|
<a href="https://vencord.dev" target="_blank">Vencord Website</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/Vencord/Desktop" target="_blank">Source Code</a>
|
<a href="https://github.com/Vencord/Vesktop" target="_blank">Source Code</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/Vencord/Desktop/issues" target="_blank">Report bugs / Request features</a>
|
<a href="https://github.com/Vencord/Vesktop/issues" target="_blank">Report bugs / Request features</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Acknowledgements</h2>
|
<h2>Acknowledgements</h2>
|
||||||
<p>These awesome libraries empower Vencord Desktop</p>
|
<p>These awesome libraries empower Vesktop</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/electron/electron" target="_blank">Electron</a>
|
<a href="https://github.com/electron/electron" target="_blank">Electron</a>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
And many
|
And many
|
||||||
<a href="https://github.com/Vencord/Desktop/blob/main/pnpm-lock.yaml" target="_blank"
|
<a href="https://github.com/Vencord/Vesktop/blob/main/pnpm-lock.yaml" target="_blank"
|
||||||
>more awesome open source libraries</a
|
>more awesome open source libraries</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Welcome to Vencord Desktop</h1>
|
<h1>Welcome to Vesktop</h1>
|
||||||
<p>Let's customise your experience!</p>
|
<p>Let's customise your experience!</p>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
<label>
|
<label>
|
||||||
<div>
|
<div>
|
||||||
<h2>Start with System</h2>
|
<h2>Start with System</h2>
|
||||||
<span>Automatically open Vencord Desktop when your computer starts</span>
|
<span>Automatically open Vesktop when your computer starts</span>
|
||||||
</div>
|
</div>
|
||||||
<input type="checkbox" name="autoStart" />
|
<input type="checkbox" name="autoStart" />
|
||||||
</label>
|
</label>
|
||||||
|
|
|
@ -36,6 +36,6 @@
|
||||||
alt="shiggy"
|
alt="shiggy"
|
||||||
role="presentation"
|
role="presentation"
|
||||||
/>
|
/>
|
||||||
<p>Loading Vencord Desktop...</p>
|
<p>Loading Vesktop...</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<section>
|
<section>
|
||||||
<h1>Update Available</h1>
|
<h1>Update Available</h1>
|
||||||
<p>There's a new update for Vencord Desktop! Update now to get new fixes and features!</p>
|
<p>There's a new update for Vesktop! Update now to get new fixes and features!</p>
|
||||||
<p>
|
<p>
|
||||||
Current: <span id="current"></span>
|
Current: <span id="current"></span>
|
||||||
<br />
|
<br />
|
||||||
|
|
Reference in a new issue