added ipcRenderer.send("get-github-theme", "url")
This commit is contained in:
parent
ceb61e7e14
commit
fb65965d82
3 changed files with 23 additions and 2 deletions
|
@ -33,6 +33,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/electron": "^2.5.4",
|
"@sentry/electron": "^2.5.4",
|
||||||
"@sentry/integrations": "^6.17.4",
|
"@sentry/integrations": "^6.17.4",
|
||||||
|
"adm-zip": "^0.5.9",
|
||||||
"discord-rpc": "^4.0.1",
|
"discord-rpc": "^4.0.1",
|
||||||
"ejs": "^3.1.6",
|
"ejs": "^3.1.6",
|
||||||
"electron-fetch": "^1.7.4",
|
"electron-fetch": "^1.7.4",
|
||||||
|
|
|
@ -13,6 +13,7 @@ import {wsapi} from "./wsapi";
|
||||||
import {jsonc} from "jsonc";
|
import {jsonc} from "jsonc";
|
||||||
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
import {AppImageUpdater, NsisUpdater} from "electron-updater";
|
||||||
import {utils} from './utils';
|
import {utils} from './utils';
|
||||||
|
const AdmZip = require("adm-zip");
|
||||||
|
|
||||||
|
|
||||||
export class BrowserWindow {
|
export class BrowserWindow {
|
||||||
|
@ -370,6 +371,20 @@ export class BrowserWindow {
|
||||||
event.returnValue = process.platform;
|
event.returnValue = process.platform;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ipcMain.on("get-github-theme", async (event, url) => {
|
||||||
|
if (url.endsWith("/")) url = url.slice(0, -1);
|
||||||
|
let response = await fetch(
|
||||||
|
`${url}/archive/refs/heads/main.zip`
|
||||||
|
);
|
||||||
|
let zip = await response.buffer();
|
||||||
|
let zipFile = new AdmZip(zip);
|
||||||
|
zipFile.extractAllTo(utils.getPath("themes"), true);
|
||||||
|
BrowserWindow.win.webContents.send("theme-installed", "");
|
||||||
|
event.returnValue = {
|
||||||
|
success: true,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
ipcMain.on("get-themes", (event, _key) => {
|
ipcMain.on("get-themes", (event, _key) => {
|
||||||
if (existsSync(utils.getPath("themes"))) {
|
if (existsSync(utils.getPath("themes"))) {
|
||||||
// return any .less files and scan any folders in the themes folder for .less files
|
// return any .less files and scan any folders in the themes folder for .less files
|
||||||
|
|
|
@ -693,6 +693,11 @@ const app = new Vue({
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ipcRenderer.on("theme-installed", (event, arg) => {
|
||||||
|
notyf.success("Theme installed")
|
||||||
|
//app.setTheme(arg)
|
||||||
|
})
|
||||||
|
|
||||||
MusicKit.getInstance().videoContainerElement = document.getElementById("apple-music-video-player")
|
MusicKit.getInstance().videoContainerElement = document.getElementById("apple-music-video-player")
|
||||||
|
|
||||||
ipcRenderer.on('SoundCheckTag', (event, tag) => {
|
ipcRenderer.on('SoundCheckTag', (event, tag) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue