mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
discord: dual templating - Midnight or Material Design, up to the user to select his favorite in the discord client.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @name Material Noctalia
|
||||
* @name Noctalia Material
|
||||
* @version 3.0.6
|
||||
* @description A fork of Material Discord for Noctalia Shell
|
||||
* @description A fork of 'Material Discord' for Noctalia Shell
|
||||
* @author CapnKitten
|
||||
*
|
||||
* @website http://github.com/CapnKitten
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @name noctalia-midnight
|
||||
* @description a fork of midnight for noctalia-shell
|
||||
* @name Noctalia Midnight
|
||||
* @description A fork of 'Midnight' for Noctalia Shell
|
||||
* @author refact0r
|
||||
* @version 2.1.1
|
||||
* @invite nz87hXyvcy
|
||||
@@ -222,17 +222,23 @@ Singleton {
|
||||
const homeDir = Quickshell.env("HOME");
|
||||
TemplateRegistry.applications.forEach(app => {
|
||||
if (app.id === "discord") {
|
||||
// Handle Discord clients specially
|
||||
// Handle Discord clients specially - multiple CSS themes
|
||||
if (isTemplateEnabled("discord")) {
|
||||
app.clients.forEach(client => {
|
||||
// Check if this specific client is detected
|
||||
if (isDiscordClientEnabled(client.name)) {
|
||||
lines.push(`\n[templates.discord_${client.name}]`);
|
||||
lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${app.input}"`);
|
||||
const outputPath = client.path.replace("~", homeDir) + "/themes/noctalia.theme.css";
|
||||
lines.push(`output_path = "${outputPath}"`);
|
||||
}
|
||||
});
|
||||
const inputs = Array.isArray(app.input) ? app.input : [app.input];
|
||||
inputs.forEach((inputFile, idx) => {
|
||||
// Derive theme suffix from input filename: discord-midnight.css → midnight
|
||||
const themeSuffix = inputFile.replace(/^discord-/, "").replace(/\.css$/, "");
|
||||
app.clients.forEach(client => {
|
||||
if (isDiscordClientEnabled(client.name)) {
|
||||
lines.push(`\n[templates.discord_${themeSuffix}_${client.name}]`);
|
||||
lines.push(`input_path = "${Quickshell.shellDir}/Assets/Templates/${inputFile}"`);
|
||||
// First input uses legacy name for backward compatibility
|
||||
const outputFile = idx === 0 ? "noctalia.theme.css" : `noctalia-${themeSuffix}.theme.css`;
|
||||
const outputPath = client.path.replace("~", homeDir) + `/themes/${outputFile}`;
|
||||
lines.push(`output_path = "${outputPath}"`);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else if (app.id === "code") {
|
||||
// Handle Code clients specially
|
||||
|
||||
@@ -147,7 +147,7 @@ Singleton {
|
||||
"id": "discord",
|
||||
"name": "Discord",
|
||||
"category": "misc",
|
||||
"input": "discord.css",
|
||||
"input": ["discord-midnight.css", "discord-material.css"],
|
||||
"clients": [
|
||||
{
|
||||
"name": "vesktop",
|
||||
|
||||
Reference in New Issue
Block a user