mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Merge branch 'canary' into dependabot/npm_and_yarn/electron-context-menu-3.1.0
This commit is contained in:
commit
70949d8414
15 changed files with 197 additions and 69 deletions
7
main.js
7
main.js
|
@ -73,6 +73,9 @@ function createWindow() {
|
|||
},
|
||||
},
|
||||
]);
|
||||
appIcon.on("click", () => {
|
||||
mainWindow.show()
|
||||
});
|
||||
|
||||
appIcon.setContextMenu(contextMenu);
|
||||
|
||||
|
@ -98,9 +101,7 @@ function createWindow() {
|
|||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
session.defaultSession.loadExtension(
|
||||
`${require("electron").app.getAppPath()}/goosemod/`
|
||||
);
|
||||
require("./utils/plugin.js");
|
||||
session
|
||||
.fromPartition("some-partition")
|
||||
.setPermissionRequestHandler((webContents, permission, callback) => {
|
||||
|
|
16
package-lock.json
generated
16
package-lock.json
generated
|
@ -9,7 +9,7 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"custom-electron-titlebar": "3.2.6",
|
||||
"electron-context-menu": "^3.1.0",
|
||||
"electron-context-menu": "^3.0.0",
|
||||
"electron-localshortcut": "^3.2.1",
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"v8-compile-cache": "^2.3.0"
|
||||
|
@ -21,7 +21,7 @@
|
|||
"@electron-forge/maker-squirrel": "^6.0.0-beta.54",
|
||||
"@electron-forge/maker-zip": "^6.0.0-beta.54",
|
||||
"@electron-forge/publisher-github": "*",
|
||||
"electron": "*"
|
||||
"electron": "latest"
|
||||
}
|
||||
},
|
||||
"node_modules/@electron-forge/async-ora": {
|
||||
|
@ -2247,9 +2247,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/electron-context-menu": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-context-menu/-/electron-context-menu-3.1.0.tgz",
|
||||
"integrity": "sha512-U7Q7d0ovfA8UOt7RCYsJkQ7l6qKMKDg3W9kvL3gEecGfHVDcjybs695L5oTS7d+kv7C2qfADo/EY06Cl4zAh9A==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-context-menu/-/electron-context-menu-3.0.0.tgz",
|
||||
"integrity": "sha512-dF0INSIIpcwofaKAXtdSKkQl08s9j0SMF+Nsi6jGBam6kfx97cIOmJLUHYlBW56DQo05umts2pRIfbcDPHNh9g==",
|
||||
"dependencies": {
|
||||
"cli-truncate": "^2.1.0",
|
||||
"electron-dl": "^3.2.1",
|
||||
|
@ -8877,9 +8877,9 @@
|
|||
}
|
||||
},
|
||||
"electron-context-menu": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-context-menu/-/electron-context-menu-3.1.0.tgz",
|
||||
"integrity": "sha512-U7Q7d0ovfA8UOt7RCYsJkQ7l6qKMKDg3W9kvL3gEecGfHVDcjybs695L5oTS7d+kv7C2qfADo/EY06Cl4zAh9A==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-context-menu/-/electron-context-menu-3.0.0.tgz",
|
||||
"integrity": "sha512-dF0INSIIpcwofaKAXtdSKkQl08s9j0SMF+Nsi6jGBam6kfx97cIOmJLUHYlBW56DQo05umts2pRIfbcDPHNh9g==",
|
||||
"requires": {
|
||||
"cli-truncate": "^2.1.0",
|
||||
"electron-dl": "^3.2.1",
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{
|
||||
"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": {
|
||||
"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",
|
||||
|
|
55
renderer.js
55
renderer.js
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
91
theme.html
Normal file
91
theme.html
Normal file
|
@ -0,0 +1,91 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>ArmCord Theme Manager</title>
|
||||
<style>
|
||||
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
|
||||
|
||||
:root {
|
||||
background-color: #2c2f33;
|
||||
--header-secondary: #b9bbbe;
|
||||
--header-primary: #fff;
|
||||
--background-tertiary: #202225;
|
||||
}
|
||||
|
||||
body {
|
||||
color: white;
|
||||
}
|
||||
|
||||
p {
|
||||
color: white;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 0px;
|
||||
text-align: center;
|
||||
transform: translateY(-105%);
|
||||
}
|
||||
|
||||
.logo:before {
|
||||
content: "ARM";
|
||||
color: #7289da;
|
||||
font-weight: normal;
|
||||
font-family: Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
font-family: Discordinated;
|
||||
font-size: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
color: #fff;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
button.back-btn {
|
||||
position: absolute;
|
||||
background-color: #7289da;
|
||||
font-family: Whitney,"Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
color: #ffffff;
|
||||
padding: 4px;
|
||||
border-radius: 5px;
|
||||
width: 105px;
|
||||
height: 25px;
|
||||
margin-top: 5px;
|
||||
margin-left: 5px;
|
||||
text-align: center;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button.back-btn:hover {
|
||||
background-color: #687dc6;
|
||||
border-style: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button.back-btn:active {
|
||||
background-color: #5c6fb1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="https://discord.com/app"><button class="back-btn">Back to Discord</button></a>
|
||||
<p class="logo">Cord Theme Manager</p>
|
||||
<div id="tm-list"></div>
|
||||
</body>
|
||||
</html>
|
23
utils/plugin.js
Normal file
23
utils/plugin.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
const fs = require("fs");
|
||||
const { app, session } = require("electron");
|
||||
const pluginFolder = __dirname + "/plugins/";
|
||||
app.whenReady().then(() => {
|
||||
fs.readdirSync(pluginFolder).forEach((file) => {
|
||||
console.log(file);
|
||||
try {
|
||||
const manifest = fs.readFileSync(
|
||||
`${__dirname}/plugins/${file}/manifest.json`,
|
||||
"utf8"
|
||||
);
|
||||
var pluginFile = JSON.parse(manifest);
|
||||
console.log(pluginFile);
|
||||
session.defaultSession.loadExtension(`${__dirname}/plugins/${file}/`);
|
||||
console.log(
|
||||
`%cLoaded ${pluginFile.name} made by ${pluginFile.author}`,
|
||||
"color:red"
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "GooseMod",
|
||||
"version": "1.0",
|
||||
"author": "AAGaming00",
|
||||
"description": "Loads GooseMod, a discord client modification",
|
||||
"background": {
|
||||
"scripts": [
|
25
utils/theme.js
Normal file
25
utils/theme.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const fs = require("fs");
|
||||
const armcord = require("./armcord.js");
|
||||
const themeFolder = __dirname + "/themes/";
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
fs.readdirSync(themeFolder).forEach((file) => {
|
||||
console.log(file);
|
||||
try {
|
||||
const manifest = fs.readFileSync(`${__dirname}/themes/${file}/manifest.json`, "utf8");
|
||||
var themeFile = JSON.parse(manifest);
|
||||
console.log(themeFile.theme);
|
||||
console.log(themeFile)
|
||||
const theme = fs.readFileSync(`${__dirname}/themes/${file}/${themeFile.theme}`, "utf8");
|
||||
if (themeFile.theme.endsWith(".scss")) {
|
||||
console.log(
|
||||
`%cCouldn't load ${themeFile.name} made by ${themeFile.author}. ArmCord doesn't support scss files if you want to have this theme ported feel free to reach out https://discord.gg/F25bc4RYDt `,
|
||||
"color:red; font-weight: bold; font-size: 50px;color: red;"
|
||||
);
|
||||
}
|
||||
armcord.addStyle(theme);
|
||||
console.log(`%cLoaded ${themeFile.name} made by ${themeFile.author}`, "color:red");
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
});
|
||||
});
|
21
utils/themes/GT-RevertRebrand-main/LICENSE
Normal file
21
utils/themes/GT-RevertRebrand-main/LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 GooseNest
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
3
utils/themes/GT-RevertRebrand-main/README.md
Normal file
3
utils/themes/GT-RevertRebrand-main/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# GT-RevertRebrand ArmCord
|
||||
|
||||
Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more)
|
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* @name Revert Rebrand
|
||||
* @author GooseNest
|
||||
* @description Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more)
|
||||
* @invite neMncS2
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
@import url('https://Goose-Nest.github.io/GT-RevertRebrand/src/main.css');
|
8
utils/themes/GT-RevertRebrand-main/manifest.json
Normal file
8
utils/themes/GT-RevertRebrand-main/manifest.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "Revert Rebrand",
|
||||
"description": "Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more)",
|
||||
"version": "3.0",
|
||||
"author": "GooseNest",
|
||||
"license": "MIT",
|
||||
"theme": "RevertRebrand.theme.css"
|
||||
}
|
Loading…
Reference in a new issue