This commit is contained in:
smartfridge 2021-07-15 15:45:56 +02:00
parent c76cf4f6cf
commit df571930cf
6 changed files with 23 additions and 8 deletions

View file

@ -11,6 +11,8 @@
<button id="open-themes-btn">Themes Folder</button> <button id="open-themes-btn">Themes Folder</button>
<p class="logo">Cord Manager</p> <p class="logo">Cord Manager</p>
<div id="tm-list"></div> <div id="tm-list"></div>
<p>Disabled Themes:</p>
<div id="tm-disabled"></div>
<p id="ac-channel"></p> <p id="ac-channel"></p>
</body> </body>
</html> </html>

View file

@ -1,5 +1,5 @@
{ {
"name": "armcord", "name": "ArmCord",
"version": "2.5.0", "version": "2.5.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",

View file

@ -1,3 +0,0 @@
{
"channel": "stable"
}

View file

@ -1,6 +1,15 @@
exports.Version = require("../package.json").version; exports.Version = require("../package.json").version;
const fs = require("fs");
exports.Channel = require("../settings.json").channel; const electron = require("electron");
const userDataPath = (electron.app || electron.remote.app).getPath("userData");
const settingsFile= userDataPath + "/settings.json";
if (!fs.existsSync(settingsFile)) {
fs.writeFile(settingsFile, "{}", (err) => {
if (err) throw err;
});
console.log("Created settings.json file");
}
exports.Channel = require(settingsFile).channel;
exports.addStyle = function(styleString) { exports.addStyle = function(styleString) {
const style = document.createElement('style'); const style = document.createElement('style');

View file

@ -39,7 +39,7 @@ if (!fs.existsSync(pluginFolder)) {
type: "warning", type: "warning",
message: "ArmCord has installed GooseMod onto your client.", message: "ArmCord has installed GooseMod onto your client.",
detail: detail:
"If you wish to use it restart your ArmCord completely using tray icon. It should appear in next session. GooseMod is reccomended to every user of ArmCord due to various improvements and bugfixes it ships with.", "If you wish to use it restart your ArmCord completely using tray icon. It should appear in next session. GooseMod is reccomended to every user of ArmCord due to various improvements and bugfixes it ships with. You won't be able to load themes or see any of ArmCord specific CSS patches including fixed font logo at the top.",
}); });
}); });
} }

View file

@ -9,9 +9,16 @@ if (!fs.existsSync(themeFolder)) {
console.log("Created theme folder"); console.log("Created theme folder");
} }
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
console.log("Theme Module Loaded"); console.log("Theme Module Loaded"); // I KNOW THIS IS A MESS BUT IT'S WORKING MESS, XOXO
fs.readdirSync(themeFolder).forEach((file) => { fs.readdirSync(themeFolder).forEach((file) => {
try { try {
if (file.includes('DISABLED')) {
console.log(`Skipping ${file}.`)
const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8");
var themeFile = JSON.parse(manifest);
var html = `<div id="tm-list-item"><div id="theme-name">${themeFile.name}</div><div id="theme-author">By ${themeFile.author}</div><div id="theme-description">${themeFile.description}</div></div><br><br>`;
document.getElementById("tm-disabled").innerHTML = html + document.getElementById("tm-disabled").innerHTML;
}
const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8"); const manifest = fs.readFileSync(`${userDataPath}/themes/${file}/manifest.json`, "utf8");
var themeFile = JSON.parse(manifest); var themeFile = JSON.parse(manifest);
const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8"); const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8");