From f887513e0953ec8a15fd02c5a763b8ad26039822 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Mon, 10 May 2021 16:35:07 +0200 Subject: [PATCH 01/19] Follow Discord tray behaviour --- main.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.js b/main.js index dd0ff40..565d915 100644 --- a/main.js +++ b/main.js @@ -73,6 +73,9 @@ function createWindow() { }, }, ]); + appIcon.on("click", () => { + mainWindow.show() + }); appIcon.setContextMenu(contextMenu); From 522ffa9ea0e9759390604a65f04fa7c7a0c6c5c8 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 14 May 2021 16:59:42 +0200 Subject: [PATCH 02/19] Tweak electon-forge config --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0eec7e7..dd09d8d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "main": "main.js", "scripts": { "start": "electron-forge start", - "dist": "electron-builder", "test": "echo \"Error: no test specified\" && exit 1", "package": "electron-forge package", "publish": "electron-forge publish", @@ -44,7 +43,9 @@ "homepage": "https://github.com/smartfrigde/armcord#readme", "config": { "forge": { - "packagerConfig": {}, + "packagerConfig": { + "icon": "discord.png" + }, "makers": [ { "name": "@electron-forge/maker-squirrel", From d5012e79a15069bba3e97a33ce9e77322837d3e7 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 14 May 2021 17:00:00 +0200 Subject: [PATCH 03/19] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd09d8d..3ff0d25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "armcord", - "version": "2.4.0", + "version": "2.5.0", "description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.", "main": "main.js", "scripts": { From 3b35a9f8888f068834403e2e71f0a224649a24a9 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 14 May 2021 17:03:08 +0200 Subject: [PATCH 04/19] Bump version and remove vulnerabilities (npm audit fix) --- package-lock.json | 74 +++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5d0f06..86f2969 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "armcord", - "version": "2.3.0", + "version": "2.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "2.3.0", + "version": "2.5.0", "license": "MIT", "dependencies": { "custom-electron-titlebar": "3.2.6", @@ -4029,6 +4029,12 @@ "node": ">=0.10.0" } }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, "node_modules/http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -4428,9 +4434,9 @@ } }, "node_modules/lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "node_modules/lodash._reinterpolate": { @@ -5090,12 +5096,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "node_modules/normalize-package-data/node_modules/hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "node_modules/normalize-package-data/node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -5639,14 +5639,14 @@ } }, "node_modules/plist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", + "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", "dev": true, "dependencies": { - "base64-js": "^1.2.3", + "base64-js": "^1.5.1", "xmlbuilder": "^9.0.7", - "xmldom": "0.1.x" + "xmldom": "^0.5.0" }, "engines": { "node": ">=6" @@ -6916,12 +6916,12 @@ } }, "node_modules/xmldom": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", - "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==", "dev": true, "engines": { - "node": ">=0.1" + "node": ">=10.0.0" } }, "node_modules/xtend": { @@ -10308,6 +10308,12 @@ "parse-passwd": "^1.0.0" } }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, "http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", @@ -10624,9 +10630,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "lodash._reinterpolate": { @@ -11155,12 +11161,6 @@ "validate-npm-package-license": "^3.0.1" }, "dependencies": { - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -11579,14 +11579,14 @@ } }, "plist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz", - "integrity": "sha512-GpgvHHocGRyQm74b6FWEZZVRroHKE1I0/BTjAmySaohK+cUn+hZpbqXkc3KWgW3gQYkqcQej35FohcT0FRlkRQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", + "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", "dev": true, "requires": { - "base64-js": "^1.2.3", + "base64-js": "^1.5.1", "xmlbuilder": "^9.0.7", - "xmldom": "0.1.x" + "xmldom": "^0.5.0" } }, "prepend-http": { @@ -12615,9 +12615,9 @@ "dev": true }, "xmldom": { - "version": "0.1.31", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz", - "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==", "dev": true }, "xtend": { From 7dab560a994f8708fb1ef7059a7e9984dccb6cdd Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 14 May 2021 17:17:39 +0200 Subject: [PATCH 05/19] Create theme.html --- theme.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 theme.html diff --git a/theme.html b/theme.html new file mode 100644 index 0000000..e69de29 From 38edef38ee77340a65740244b0aff208813c9c15 Mon Sep 17 00:00:00 2001 From: smartfridge <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 14 May 2021 17:35:25 +0200 Subject: [PATCH 06/19] Add shortcut to theme manager and make base for it --- preload.js | 3 +++ renderer.js | 55 --------------------------------------- theme.html | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 55 deletions(-) delete mode 100644 renderer.js diff --git a/preload.js b/preload.js index 137d858..52af680 100644 --- a/preload.js +++ b/preload.js @@ -22,6 +22,9 @@ window.addEventListener("DOMContentLoaded", () => { electronLocalshortcut.register(currentWindow, "F2", () => { window.location.href = "https://discord.com/invite/F25bc4RYDt"; }); + electronLocalshortcut.register(currentWindow, "F3", () => { + window.location.href = "./theme.html"; + }); require("./utils/capturer.js"); ArmCord.addStyle(` diff --git a/renderer.js b/renderer.js deleted file mode 100644 index d2ec9f5..0000000 --- a/renderer.js +++ /dev/null @@ -1,55 +0,0 @@ -// This file is required by the index.html file and will -// be executed in the renderer process for that window. -// All of the Node.js APIs are available in this process. -const remote = require('electron').remote; - -const win = remote.getCurrentWindow(); /* Note this is different to the -html global `window` variable */ - -// When document has loaded, initialise -document.onreadystatechange = (event) => { - if (document.readyState == "complete") { - handleWindowControls(); - - document.getElementById('electron-ver').innerHTML = `${process.versions.electron}` - } -}; - -window.onbeforeunload = (event) => { - /* If window is reloaded, remove win event listeners - (DOM element listeners get auto garbage collected but not - Electron win listeners as the win is not dereferenced unless closed) */ - win.removeAllListeners(); -} - -function handleWindowControls() { - // Make minimise/maximise/restore/close buttons work when they are clicked - document.getElementById('min-button').addEventListener("click", event => { - win.minimize(); - }); - - document.getElementById('max-button').addEventListener("click", event => { - win.maximize(); - }); - - document.getElementById('restore-button').addEventListener("click", event => { - win.unmaximize(); - }); - - document.getElementById('close-button').addEventListener("click", event => { - win.close(); - }); - - // Toggle maximise/restore buttons when maximisation/unmaximisation occurs - toggleMaxRestoreButtons(); - win.on('maximize', toggleMaxRestoreButtons); - win.on('unmaximize', toggleMaxRestoreButtons); - - function toggleMaxRestoreButtons() { - if (win.isMaximized()) { - document.body.classList.add('maximized'); - } else { - document.body.classList.remove('maximized'); - } - } -} \ No newline at end of file diff --git a/theme.html b/theme.html index e69de29..569d7dd 100644 --- a/theme.html +++ b/theme.html @@ -0,0 +1,75 @@ + + + +
+ +