Merge branch 'main' into main

This commit is contained in:
smartfridge 2021-05-10 09:50:04 +02:00 committed by GitHub
commit 1b5350dde3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 37 deletions

View file

@ -1,7 +1,6 @@
{
"name": "GooseMod",
"version": "1.0",
"author": "AAGaming",
"description": "Loads GooseMod, a discord client modification",
"background": {
"scripts": [

16
main.js
View file

@ -2,9 +2,17 @@
const { app, BrowserWindow, session, Tray, Menu } = require("electron");
const path = require("path");
const contextMenu = require("electron-context-menu");
const os = require("os");
require("v8-compile-cache");
require("./utils/updater");
if (os.type() == 'Linux'){
var iconformat = __dirname + "/discord.png"
} else { //test this
console.log("Running Non-Linux")
var iconformat = __dirname + "/discord.ico";
}
contextMenu({
prepend: (defaultActions, parameters, browserWindow) => [
{
@ -21,7 +29,7 @@ function createWindow() {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
icon: __dirname + "/discord.png",
icon: iconformat,
title: "ArmCord",
frame: false,
webPreferences: {
@ -31,7 +39,7 @@ function createWindow() {
},
});
var appIcon = new Tray(__dirname + "/discord.ico");
var appIcon = new Tray(iconformat);
mainWindow.webContents.userAgent =
"Mozilla/5.0 (X12; FreeBSD x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent
mainWindow.loadFile("index.html");
@ -106,6 +114,10 @@ app.whenReady().then(() => {
// Approves the permissions request
callback(true);
}
if (!url.startsWith("discord://")) {
// Denies the permissions request
return callback(false);
}
});
app.on("activate", function () {
// On macOS it's common to re-create a window in the app when the

View file

@ -1,6 +1,6 @@
{
"name": "armcord",
"version": "2.3.3",
"version": "2.4.0",
"description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
"main": "main.js",
"scripts": {

View file

@ -1,32 +1,31 @@
const customTitlebar = require('custom-electron-titlebar')
const customTitlebar = require("custom-electron-titlebar");
const electronLocalshortcut = require("electron-localshortcut");
const { remote } = require("electron");
const ArmCord = require("./utils/ArmCord.js")
const ArmCord = require("./utils/ArmCord.js");
window.addEventListener('DOMContentLoaded', () => {
window.addEventListener("DOMContentLoaded", () => {
new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex("#202225"),
menu: false,
});
const currentWindow = remote.getCurrentWindow();
electronLocalshortcut.register(currentWindow, "F5", () => {
location.reload();
});
electronLocalshortcut.register(currentWindow, "F12", () => {
currentWindow.webContents.openDevTools();
});
electronLocalshortcut.register(currentWindow, "F1", () => {
require("shell").openExternal("https://support.discord.com/")
});
electronLocalshortcut.register(currentWindow, "F2", () => {
window.location.href = "https://discord.com/invite/F25bc4RYDt"
});
require("./utils/capturer.js")
const currentWindow = remote.getCurrentWindow();
electronLocalshortcut.register(currentWindow, "F5", () => {
location.reload();
});
electronLocalshortcut.register(currentWindow, "F12", () => {
currentWindow.webContents.openDevTools();
});
electronLocalshortcut.register(currentWindow, "F1", () => {
require("shell").openExternal("https://support.discord.com/");
});
electronLocalshortcut.register(currentWindow, "F2", () => {
window.location.href = "https://discord.com/invite/F25bc4RYDt";
});
require("./utils/capturer.js");
ArmCord.addStyle(`
ArmCord.addStyle(`
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
:root {
--window-buttons: var(--header-secondary);
--cord-color: var(--header-primary);
@ -42,11 +41,9 @@ ArmCord.addStyle(`
overflow: hidden;
border-top-left-radius: 8px;
}
div.menubar[role="menubar"] {
width: 0px;
}
.window-title:after {
content: "Cord";
color: var(--cord-color) !important;
@ -54,7 +51,6 @@ div.menubar[role="menubar"] {
font-size: 14px;
font-family: Discordinated;
}
.window-title:before {
content: "ARM";
color: var(--armcord-color);
@ -62,30 +58,31 @@ div.menubar[role="menubar"] {
font-size: 14px;
font-family: Helvetica, sans-serif;
}
.window-title {
font-size: 0px !important;
margin-left: initial !important;
transform: translate(10px, 2px) !important;
}
.titlebar {
background: var(--background-tertiary) !important;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
.titlebar .window-controls-container .window-icon {
background: var(--window-buttons) !important;
}
`);
ArmCord.addStyle(`.info-1VyQPT:last-child:before {
content: "ArmCord Version: ` + ArmCord.Version + `";
ArmCord.addStyle(
`.info-1VyQPT:last-child:before {
content: "ArmCord Version: ` +
ArmCord.Version +
`";
height: auto;
line-height: 16px;
text-align: center;
color: var(--text-muted);
font-size: 12px;
text-transform: none;
}`);
})
}`
);
});

View file

@ -1,13 +1,13 @@
exports.Version = require("../package.json").version;
exports.addStyle = function(styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
};
exports.addScript = function(scriptString) {
var script = document.createElement('script');
exports.addScript = function (scriptString) {
var script = document.createElement("script");
script.textContent = scriptString;
document.body.append(script);
};
};