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", "name": "GooseMod",
"version": "1.0", "version": "1.0",
"author": "AAGaming",
"description": "Loads GooseMod, a discord client modification", "description": "Loads GooseMod, a discord client modification",
"background": { "background": {
"scripts": [ "scripts": [

16
main.js
View file

@ -2,9 +2,17 @@
const { app, BrowserWindow, session, Tray, Menu } = require("electron"); const { app, BrowserWindow, session, Tray, Menu } = require("electron");
const path = require("path"); const path = require("path");
const contextMenu = require("electron-context-menu"); const contextMenu = require("electron-context-menu");
const os = require("os");
require("v8-compile-cache"); require("v8-compile-cache");
require("./utils/updater"); 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({ contextMenu({
prepend: (defaultActions, parameters, browserWindow) => [ prepend: (defaultActions, parameters, browserWindow) => [
{ {
@ -21,7 +29,7 @@ function createWindow() {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 800, width: 800,
height: 600, height: 600,
icon: __dirname + "/discord.png", icon: iconformat,
title: "ArmCord", title: "ArmCord",
frame: false, frame: false,
webPreferences: { webPreferences: {
@ -31,7 +39,7 @@ function createWindow() {
}, },
}); });
var appIcon = new Tray(__dirname + "/discord.ico"); var appIcon = new Tray(iconformat);
mainWindow.webContents.userAgent = 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 "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"); mainWindow.loadFile("index.html");
@ -106,6 +114,10 @@ app.whenReady().then(() => {
// Approves the permissions request // Approves the permissions request
callback(true); callback(true);
} }
if (!url.startsWith("discord://")) {
// Denies the permissions request
return callback(false);
}
}); });
app.on("activate", function () { app.on("activate", function () {
// On macOS it's common to re-create a window in the app when the // On macOS it's common to re-create a window in the app when the

View file

@ -1,6 +1,6 @@
{ {
"name": "armcord", "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.", "description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View file

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

View file

@ -7,7 +7,7 @@ exports.addStyle = function(styleString) {
}; };
exports.addScript = function (scriptString) { exports.addScript = function (scriptString) {
var script = document.createElement('script'); var script = document.createElement("script");
script.textContent = scriptString; script.textContent = scriptString;
document.body.append(script); document.body.append(script);
}; };