aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-09-25 18:53:10 +0200
committerV <vendicated@riseup.net>2023-09-25 18:53:10 +0200
commitae6584da7c38fd0f3414e3cb650b35a9a9b831be (patch)
treecb44b6a69e44a121b573fea9ba4a72876e918732 /src/main
parentc6b1b9463ced6953bc7ba17fd26f9e463fb0b010 (diff)
downloadVencord-ae6584da7c38fd0f3414e3cb650b35a9a9b831be.tar.gz
Vencord-ae6584da7c38fd0f3414e3cb650b35a9a9b831be.tar.bz2
Vencord-ae6584da7c38fd0f3414e3cb650b35a9a9b831be.zip
add os-accent-color variable (following BetterDiscord)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/ipcMain.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/ipcMain.ts b/src/main/ipcMain.ts
index 61cbe7a..6254bc8 100644
--- a/src/main/ipcMain.ts
+++ b/src/main/ipcMain.ts
@@ -22,7 +22,7 @@ import "./ipcPlugins";
import { debounce } from "@utils/debounce";
import { IpcEvents } from "@utils/IpcEvents";
import { Queue } from "@utils/Queue";
-import { BrowserWindow, ipcMain, shell } from "electron";
+import { BrowserWindow, ipcMain, shell, systemPreferences } from "electron";
import { mkdirSync, readFileSync, watch } from "fs";
import { open, readdir, readFile, writeFile } from "fs/promises";
import { join, normalize } from "path";
@@ -112,6 +112,10 @@ ipcMain.handle(IpcEvents.SET_QUICK_CSS, (_, css) =>
ipcMain.handle(IpcEvents.GET_THEMES_DIR, () => THEMES_DIR);
ipcMain.handle(IpcEvents.GET_THEMES_LIST, () => listThemes());
ipcMain.handle(IpcEvents.GET_THEME_DATA, (_, fileName) => getThemeData(fileName));
+ipcMain.handle(IpcEvents.GET_THEME_SYSTEM_VALUES, () => ({
+ // win & mac only
+ "os-accent-color": `#${systemPreferences.getAccentColor?.() || ""}`
+}));
ipcMain.handle(IpcEvents.GET_SETTINGS_DIR, () => SETTINGS_DIR);
ipcMain.on(IpcEvents.GET_SETTINGS, e => e.returnValue = readSettings());