Compare commits

..

No commits in common. "30367157243c186e37e6aba130c413b809ef4538" and "97589220f4f068651592d78f3ce8398d77ca005e" have entirely different histories.

9 changed files with 46 additions and 2341 deletions

View file

@ -19,17 +19,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install bash
run: sudo apt install -y bash
- name: Install pnpm
run: npm i -g pnpm && /bin/bash pnpm setup
- name: Install Node dependencies - name: Install Node dependencies
run: pnpm install -g cargo-cp-artifact && pnpm install run: npm install
- name: Install Electron-Builder - name: Install Electron-Builder
run: pnpm install -g electron-builder run: npm install -g electron-builder
- name: Replace the version number - name: Replace the version number
run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null
@ -59,14 +53,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install pnpm
run: npm i -g pnpm && pnpm setup && source /Users/runner/.bashrc
- name: Install Node dependencies - name: Install Node dependencies
run: pnpm install -g cargo-cp-artifact && pnpm install run: npm install
- name: Install Electron-Builder - name: Install Electron-Builder
run: pnpm install -g electron-builder run: npm install -g electron-builder
- name: Replace the version number - name: Replace the version number
run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null
@ -93,14 +84,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install pnpm
run: npm i -g pnpm && pnpm setup && powershell
- name: Install Node dependencies - name: Install Node dependencies
run: pnpm install run: npm install
- name: Install Electron-Builder - name: Install Electron-Builder
run: pnpm install -g cargo-cp-artifact && pnpm install run: npm install -g electron-builder
- name: Replace the version number - name: Replace the version number
run: (Get-Content src/utils.ts) -replace "\d\.\d\.\d", "DEV" | Out-File src/utils.ts run: (Get-Content src/utils.ts) -replace "\d\.\d\.\d", "DEV" | Out-File src/utils.ts

View file

@ -19,14 +19,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install pnpm
run: npm i -g pnpm && pnpm setup
- name: Install Node dependencies - name: Install Node dependencies
run: pnpm install -g cargo-cp-artifact && pnpm install run: npm install
- name: Install Electron-Builder - name: Install Electron-Builder
run: pnpm install -g electron-builder run: npm install -g electron-builder
- name: Build - name: Build
run: npm run build && electron-builder --linux && electron-builder --arm64 --linux && electron-builder --armv7l --linux run: npm run build && electron-builder --linux && electron-builder --arm64 --linux && electron-builder --armv7l --linux
@ -54,14 +51,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install pnpm
run: npm i -g pnpm && pnpm setup && source /Users/runner/.bashrc
- name: Install Node dependencies - name: Install Node dependencies
run: pnpm install -g cargo-cp-artifact && pnpm install run: npm install
- name: Install Electron-Builder - name: Install Electron-Builder
run: pnpm install -g electron-builder run: npm install -g electron-builder
- name: Build - name: Build
run: npm run build && electron-builder --macos run: npm run build && electron-builder --macos
@ -89,14 +83,11 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install pnpm
run: npm i -g pnpm && pnpm setup
- name: Install Node dependencies - name: Install Node dependencies
run: pnpm install -g cargo-cp-artifact && pnpm install run: npm install
- name: Install Electron-Builder - name: Install Electron-Builder
run: pnpm install -g electron-builder run: npm install -g electron-builder
- name: Build - name: Build
run: npm run build && electron-builder --windows run: npm run build && electron-builder --windows

View file

@ -64,9 +64,9 @@ ArmCord is also available in [Pi-Apps](https://github.com/Botspot/pi-apps).
### Compiling: ### Compiling:
Alternatively you can run ArmCord from source (NodeJS and pnpm required): Alternatively you can run ArmCord from source (NodeJS and npm required):
1. Clone ArmCord repo: `git clone https://github.com/ArmCord/ArmCord.git` 1. Clone ArmCord repo: `git clone https://github.com/ArmCord/ArmCord.git`
2. Run `pnpm install` to install dependencies 2. Run `npm install` to install dependencies
3. Build with `npm run build` 3. Build with `npm run build`
4. Compile/Package with `npm run package` 4. Compile/Package with `npm run package`

View file

@ -38,7 +38,6 @@
"typescript": "^4.7.3" "typescript": "^4.7.3"
}, },
"dependencies": { "dependencies": {
"@pyke/vibe": "^0.3.0",
"electron-context-menu": "github:ArmCord/electron-context-menu", "electron-context-menu": "github:ArmCord/electron-context-menu",
"os-locale": "^6.0.2", "os-locale": "^6.0.2",
"v8-compile-cache": "^2.3.0", "v8-compile-cache": "^2.3.0",

2226
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@ import {getConfig, checkIfConfigExists, injectElectronFlags} from "./utils";
import "./extensions/mods"; import "./extensions/mods";
import "./extensions/plugin"; import "./extensions/plugin";
import "./tray"; import "./tray";
import {createCustomWindow, createNativeWindow, createTransparentWindow} from "./window"; import {createCustomWindow, createNativeWindow} from "./window";
import path from "path"; import path from "path";
export var iconPath: string; export var iconPath: string;
export var settings: any; export var settings: any;
@ -40,9 +40,6 @@ app.whenReady().then(async () => {
case "native": case "native":
createNativeWindow(); createNativeWindow();
break; break;
case "transparent":
createTransparentWindow();
break;
case "basic": case "basic":
createNativeWindow(); createNativeWindow();
break; break;

View file

@ -20,8 +20,9 @@ app.whenReady().then(async () => {
} }
}; };
if (process.platform == "darwin" && trayPath.getSize().height > 22) trayPath = trayPath.resize({height: 22}); if (process.platform == "darwin" && trayPath.getSize().height > 22)
trayPath = trayPath.resize({height: 22});
if ((await getConfig("windowStyle")) == "basic") { if ((await getConfig("windowStyle")) == "basic") {
var clientName = (await getConfig("clientName")) ?? "ArmCord"; var clientName = (await getConfig("clientName")) ?? "ArmCord";
tray = new Tray(trayPath); tray = new Tray(trayPath);
@ -31,13 +32,13 @@ app.whenReady().then(async () => {
{ {
label: `Finish the setup first!`, label: `Finish the setup first!`,
enabled: false enabled: false
}, }, {
{
label: `Quit ${clientName}`, label: `Quit ${clientName}`,
click: async function () { click: async function () {
fs.unlink(await getConfigLocation(), (err) => { fs.unlink(await getConfigLocation(), (err) => {
if (err) throw err; if (err)
throw err;
console.log('Closed during setup. "settings.json" was deleted'); console.log('Closed during setup. "settings.json" was deleted');
app.quit(); app.quit();
}); });
@ -51,8 +52,7 @@ app.whenReady().then(async () => {
click: function () { click: function () {
mainWindow.show(); mainWindow.show();
} }
}, }, {
{
label: `Quit ${clientName}`, label: `Quit ${clientName}`,
click: function () { click: function () {
let [width, height] = mainWindow.getSize(); let [width, height] = mainWindow.getSize();
@ -74,13 +74,13 @@ app.whenReady().then(async () => {
{ {
label: `Finish the setup first!`, label: `Finish the setup first!`,
enabled: false enabled: false
}, }, {
{
label: `Quit ${clientName}`, label: `Quit ${clientName}`,
click: async function () { click: async function () {
fs.unlink(await getConfigLocation(), (err) => { fs.unlink(await getConfigLocation(), (err) => {
if (err) throw err; if (err)
throw err;
console.log('Closed during setup. "settings.json" was deleted'); console.log('Closed during setup. "settings.json" was deleted');
app.quit(); app.quit();
}); });
@ -109,18 +109,15 @@ app.whenReady().then(async () => {
click: function () { click: function () {
createSettingsWindow(); createSettingsWindow();
} }
}, }, {
{
label: "Support Discord Server", label: "Support Discord Server",
click: function () { click: function () {
mainWindow.show(); mainWindow.show();
mainWindow.loadURL("https://discord.gg/TnhxcqynZ2"); mainWindow.loadURL("https://discord.gg/TnhxcqynZ2");
} }
}, }, {
{
type: "separator" type: "separator"
}, }, {
{
label: `Quit ${clientName}`, label: `Quit ${clientName}`,
click: function () { click: function () {
app.quit(); app.quit();
@ -129,8 +126,7 @@ app.whenReady().then(async () => {
]); ]);
tray.setContextMenu(contextMenu); tray.setContextMenu(contextMenu);
} }
} } tray.setToolTip(clientName);
tray.setToolTip(clientName);
tray.on("click", function () { tray.on("click", function () {
mainWindow.show(); mainWindow.show();
}); });

View file

@ -1,10 +1,8 @@
import * as fs from "fs"; import * as fs from "fs";
import {app, dialog} from "electron"; import {app, dialog} from "electron";
import path from "path"; import path from "path";
import vibe from "@pyke/vibe";
export var firstRun: boolean; export var firstRun: boolean;
export var contentPath: string; export var contentPath: string;
export var transparency: boolean;
//utility functions that are used all over the codebase or just too obscure to be put in the file used in //utility functions that are used all over the codebase or just too obscure to be put in the file used in
export function addStyle(styleString: string) { export function addStyle(styleString: string) {
const style = document.createElement("style"); const style = document.createElement("style");
@ -120,11 +118,6 @@ export async function injectElectronFlags() {
default: default:
console.log("No performance modes set"); console.log("No performance modes set");
} }
if ((await getConfig("windowStyle")) == "transparent") {
console.log("Transparent mode enabled");
vibe.setup(app);
transparency = true;
}
} }
export async function setLang(language: string) { export async function setLang(language: string) {
const langConfigFile = path.join(app.getPath("userData"), "/storage/") + "lang.json"; const langConfigFile = path.join(app.getPath("userData"), "/storage/") + "lang.json";

View file

@ -4,16 +4,7 @@
// I'm sorry for this mess but I'm not sure how to fix it. // I'm sorry for this mess but I'm not sure how to fix it.
import {BrowserWindow, shell, app, dialog, nativeImage} from "electron"; import {BrowserWindow, shell, app, dialog, nativeImage} from "electron";
import path from "path"; import path from "path";
import { import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, setConfig, setLang, setWindowState} from "./utils";
checkIfConfigIsBroken,
firstRun,
getConfig,
contentPath,
setConfig,
setLang,
setWindowState,
transparency
} from "./utils";
import {registerIpc} from "./ipc"; import {registerIpc} from "./ipc";
import {setMenu} from "./menu"; import {setMenu} from "./menu";
import * as fs from "fs"; import * as fs from "fs";
@ -21,7 +12,6 @@ import startServer from "./socket";
import contextMenu from "electron-context-menu"; import contextMenu from "electron-context-menu";
import os from "os"; import os from "os";
import {tray} from "./tray"; import {tray} from "./tray";
import vibe from "@pyke/vibe";
import {iconPath} from "./main"; import {iconPath} from "./main";
export let mainWindow: BrowserWindow; export let mainWindow: BrowserWindow;
export let inviteWindow: BrowserWindow; export let inviteWindow: BrowserWindow;
@ -51,11 +41,6 @@ contextMenu({
] ]
}); });
async function doAfterDefiningTheWindow() { async function doAfterDefiningTheWindow() {
if (transparency) {
vibe.applyEffect(mainWindow, "acrylic");
vibe.setDarkMode(mainWindow);
mainWindow.show();
}
var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning"); var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning");
await checkIfConfigIsBroken(); await checkIfConfigIsBroken();
registerIpc(); registerIpc();
@ -69,18 +54,18 @@ async function doAfterDefiningTheWindow() {
} }
mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work
} }
const gotTheLock = app.requestSingleInstanceLock(); const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) { if (!gotTheLock) {
app.quit(); app.quit()
} else { } else {
app.on("second-instance", (event, commandLine, workingDirectory) => { app.on('second-instance', (event, commandLine, workingDirectory) => {
// i love stack overflow // i love stack overflow
if (mainWindow) { if (mainWindow) {
mainWindow.restore(); mainWindow.restore()
mainWindow.focus(); mainWindow.focus()
} }
}); })
} }
mainWindow.webContents.setWindowOpenHandler(({url}) => { mainWindow.webContents.setWindowOpenHandler(({url}) => {
if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) { if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) {
@ -267,25 +252,7 @@ export function createNativeWindow() {
}); });
doAfterDefiningTheWindow(); doAfterDefiningTheWindow();
} }
export function createTransparentWindow() {
mainWindow = new BrowserWindow({
width: 300,
height: 350,
title: "ArmCord",
darkTheme: true,
icon: iconPath,
frame: true,
backgroundColor: "#00000000",
show: false,
autoHideMenuBar: true,
webPreferences: {
sandbox: false,
preload: path.join(__dirname, "preload/preload.js"),
spellcheck: true
}
});
doAfterDefiningTheWindow();
}
export function createInviteWindow() { export function createInviteWindow() {
inviteWindow = new BrowserWindow({ inviteWindow = new BrowserWindow({
width: 800, width: 800,