From b4ac786e8b3b4c2a127218bb359005d0cbb4ccb8 Mon Sep 17 00:00:00 2001 From: Aiser <2912778691@qq.com> Date: Mon, 10 Nov 2025 13:20:51 +0800 Subject: [PATCH] Matugen: add spicetify theme for Spotify --- Assets/MatugenTemplates/spicetify.ini | 27 +++++++++++++++++++ Assets/Translations/de.json | 4 +++ Assets/Translations/en.json | 4 +++ Assets/Translations/es.json | 4 +++ Assets/Translations/fr.json | 4 +++ Assets/Translations/pt.json | 4 +++ Assets/Translations/tr.json | 4 +++ Assets/Translations/uk-UA.json | 4 +++ Assets/Translations/zh-CN.json | 4 +++ Commons/Settings.qml | 1 + .../Panels/Settings/Tabs/ColorSchemeTab.qml | 19 ++++++++++++- Services/System/ProgramCheckerService.qml | 4 ++- Services/Theming/TemplateRegistry.qml | 10 +++++++ 13 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 Assets/MatugenTemplates/spicetify.ini diff --git a/Assets/MatugenTemplates/spicetify.ini b/Assets/MatugenTemplates/spicetify.ini new file mode 100644 index 00000000..bff30bf4 --- /dev/null +++ b/Assets/MatugenTemplates/spicetify.ini @@ -0,0 +1,27 @@ +[Comfy] +text = {{ colors.on_surface.default.hex_stripped }} +subtext = {{ colors.on_surface_variant.default.hex_stripped }} +main = {{ colors.surface.default.hex_stripped }} +main-elevated = {{ colors.surface_bright.default.hex_stripped }} +main-transition = {{ colors.surface_container_lowest.default.hex_stripped }} +highlight = {{ colors.surface_container_low.default.hex_stripped }} +highlight-elevated = {{ colors.surface_container_highest.default.hex_stripped }} +sidebar = {{ colors.surface.default.hex_stripped }} +player = {{ colors.scrim.default.hex_stripped }} +card = {{ colors.scrim.default.hex_stripped }} +shadow = {{ colors.scrim.default.hex_stripped }} +selected-row = {{ colors.on_surface.default.hex_stripped }} +button = {{ colors.primary.default.hex_stripped }} +button-active = {{ colors.primary_fixed.default.hex_stripped }} +button-disabled = {{ colors.primary_fixed_dim.default.hex_stripped }} +tab-active = {{ colors.surface.default.hex_stripped }} +notification = {{ colors.tertiary.default.hex_stripped }} +notification-error = {{ colors.error.default.hex_stripped }} +misc = {{ colors.scrim.default.hex_stripped }} +play-button = {{ colors.secondary.default.hex_stripped }} +play-button-active = {{ colors.secondary_fixed.default.hex_stripped }} +progress-fg = {{ colors.primary.default.hex_stripped }} +progress-bg = {{ colors.surface.default.hex_stripped }} +heart = {{ colors.error.default.hex_stripped }} +pagelink-active = {{ colors.on_tertiary_container.default.hex_stripped }} +radio-btn-active = {{ colors.on_tertiary_container.default.hex_stripped }} diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index f1be4512..a7f33d97 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -860,6 +860,10 @@ "description": "Schreibe {Dateipfad}. Das Hyprluna-Theme muss manuell installiert und aktiviert werden", "description-missing": "Benötigt die Installation von {app}" }, + "spicetify": { + "description": "Schreibe {Dateipfad}. Das Comfy-Theme muss manuell installiert und aktiviert werden", + "description-missing": "Benötigt die Installation von {app}" + }, "description": "Anwendungsspezifisches Theming.", "discord": { "description": "Schreibt {filepath} für {client}", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index bd3e9820..818438cc 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -860,6 +860,10 @@ "description": "Write {filepath}. Hyprluna theme needs to be installed and activated manually.", "description-missing": "Requires {app} to be installed" }, + "spicetify": { + "description": "Write {filepath}. Comfy theme needs to be installed and activated manually.", + "description-missing": "Requires {app} to be installed" + }, "description": "Application-specific theming.", "discord": { "description": "Write {filepath} for {client}. Hyprluna theme needs to be activated manually.", diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index a68676bb..c5ad8291 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -860,6 +860,10 @@ "description": "Escribe {filepath}. El tema Hyprluna debe ser instalado y activado manualmente.", "description-missing": "Requiere que {app} esté instalado/a." }, + "spicetify": { + "description": "Escribe {filepath}. El tema Comfy debe ser instalado y activado manualmente.", + "description-missing": "Requiere que {app} esté instalado/a." + }, "description": "Tematización específica de aplicaciones.", "discord": { "description": "Escribir {filepath} para {client}", diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index c4ca352f..937d7299 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -860,6 +860,10 @@ "description": "Écrire {filepath}. Le thème Hyprluna doit être installé et activé manuellement.", "description-missing": "Nécessite l'installation de {app}" }, + "spicetify": { + "description": "Écrire {filepath}. Le thème Comfy doit être installé et activé manuellement.", + "description-missing": "Nécessite l'installation de {app}" + }, "description": "Thématisation spécifique aux applications.", "discord": { "description": "Écrire {filepath} pour {client}", diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 46d05463..fc3283bf 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -860,6 +860,10 @@ "description": "Escreva em {filepath}. O tema Hyprluna precisa ser instalado e ativado manualmente.", "description-missing": "Requer que o {app} esteja instalado." }, + "spicetify": { + "description": "Escreva em {filepath}. O tema Comfy precisa ser instalado e ativado manualmente.", + "description-missing": "Requer que o {app} esteja instalado." + }, "description": "Tematização específica de aplicativos.", "discord": { "description": "Escrever {filepath} para {client}", diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 5aa2474f..e235b715 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -860,6 +860,10 @@ "description": "{filepath} dosyasına yaz. Hyprluna temasının kurulu ve manuel olarak etkinleştirilmiş olması gerekir.", "description-missing": "Kurulum için {app} gereklidir" }, + "spicetify": { + "description": "{filepath} dosyasına yaz. Comfy temasının kurulu ve manuel olarak etkinleştirilmiş olması gerekir.", + "description-missing": "Kurulum için {app} gereklidir" + }, "description": "Uygulamaya özel temalandırma.", "discord": { "description": "{client} için {filepath} dosyasına yaz. Hyprluna temasının manuel olarak etkinleştirilmesi gerekir.", diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index fbcead9d..009bf24d 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -860,6 +860,10 @@ "description": "Записати {filepath}. Тему Hyprluna потрібно встановити та активувати вручну.", "description-missing": "Потрібна установка {app}" }, + "spicetify": { + "description": "Записати {filepath}. Тему Comfy потрібно встановити та активувати вручну.", + "description-missing": "Потрібна установка {app}" + }, "description": "Оформлення окремих програм.", "discord": { "description": "Записати {filepath} для {client}. Тему Hyprluna потрібно активувати вручну.", diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 3b899fec..71c9b99f 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -860,6 +860,10 @@ "description": "写入 {filepath}。Hyprluna 主题需要手动安装和激活。", "description-missing": "需要安装 {app}" }, + "spicetify": { + "description": "写入 {filepath}。Comfy 主题需要手动安装和激活。", + "description-missing": "需要安装 {app}" + }, "description": "应用程序特定主题。", "discord": { "description": "为 {client} 写入 {filepath}", diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 3d7be7f1..9600871b 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -407,6 +407,7 @@ Singleton { property bool vicinae: false property bool walker: false property bool code: false + property bool spicetify: false property bool enableUserTemplates: false property bool discord_vesktop: false // To be deleted soon diff --git a/Modules/Panels/Settings/Tabs/ColorSchemeTab.qml b/Modules/Panels/Settings/Tabs/ColorSchemeTab.qml index b4059379..69df2e5a 100644 --- a/Modules/Panels/Settings/Tabs/ColorSchemeTab.qml +++ b/Modules/Panels/Settings/Tabs/ColorSchemeTab.qml @@ -757,8 +757,25 @@ ColumnLayout { } } } - } + NCheckbox { + label: "Spicetify" + description: ProgramCheckerService.spicetifyAvailable ? I18n.tr("settings.color-scheme.templates.programs.spicetify.description", { + "filepath": "~/.config/spicetify/Themes/Comfy/color.ini" + }) : I18n.tr("settings.color-scheme.templates.programs.spicetify.description-missing", { + "app": "spicetify" + }) + checked: Settings.data.templates.spicetify + enabled: ProgramCheckerService.spicetifyAvailable + opacity: ProgramCheckerService.spicetifyAvailable ? 1.0 : 0.6 + onToggled: checked => { + if (ProgramCheckerService.spicetifyAvailable) { + Settings.data.templates.spicetify = checked + AppThemeService.generate() + } + } + } + } // Miscellaneous NCollapsible { Layout.fillWidth: true diff --git a/Services/System/ProgramCheckerService.qml b/Services/System/ProgramCheckerService.qml index 13b2bc34..10a2eff0 100644 --- a/Services/System/ProgramCheckerService.qml +++ b/Services/System/ProgramCheckerService.qml @@ -26,6 +26,7 @@ Singleton { property bool app2unitAvailable: false property bool codeAvailable: false property bool gnomeCalendarAvailable: false + property bool spicetifyAvailable: false // Discord client auto-detection property var availableDiscordClients: [] @@ -112,7 +113,8 @@ Singleton { "gpuScreenRecorderAvailable": ["sh", "-c", "command -v gpu-screen-recorder >/dev/null 2>&1 || (command -v flatpak >/dev/null 2>&1 && flatpak list --app | grep -q 'com.dec05eba.gpu_screen_recorder')"], "wlsunsetAvailable": ["which", "wlsunset"], "codeAvailable": ["which", "code"], - "gnomeCalendarAvailable": ["which", "gnome-calendar"] + "gnomeCalendarAvailable": ["which", "gnome-calendar"], + "spicetifyAvailable": ["which", "spicetify"] }) // Internal tracking diff --git a/Services/Theming/TemplateRegistry.qml b/Services/Theming/TemplateRegistry.qml index aa0b4a32..f249144e 100644 --- a/Services/Theming/TemplateRegistry.qml +++ b/Services/Theming/TemplateRegistry.qml @@ -151,6 +151,16 @@ Singleton { "outputs": [{ "path": "~/.vscode/extensions/hyprluna.hyprluna-theme-1.0.2/themes/hyprluna.json" }] + }, + { + "id": "spicetify", + "name": "Spicetify", + "category": "applications", + "input": "spicetify.ini", + "outputs": [{ + "path": "~/.config/spicetify/Themes/Comfy/color.ini" + }], + "postProcess": () => `spicetify -q apply --no-restart` }] // Extract Discord clients for ProgramCheckerService compatibility