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>
<p class="logo">Cord Manager</p>
<div id="tm-list"></div>
<p>Disabled Themes:</p>
<div id="tm-disabled"></div>
<p id="ac-channel"></p>
</body>
</html>

View file

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

View file

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

View file

@ -1,6 +1,15 @@
exports.Version = require("../package.json").version;
exports.Channel = require("../settings.json").channel;
const fs = require("fs");
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) {
const style = document.createElement('style');

View file

@ -39,7 +39,7 @@ if (!fs.existsSync(pluginFolder)) {
type: "warning",
message: "ArmCord has installed GooseMod onto your client.",
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");
}
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) => {
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");
var themeFile = JSON.parse(manifest);
const theme = fs.readFileSync(`${userDataPath}/themes/${file}/${themeFile.theme}`, "utf8");