From fe9febf49522eef89379e9ea3767f2b570abdd91 Mon Sep 17 00:00:00 2001 From: Lemmy Date: Tue, 20 Jan 2026 09:33:25 -0500 Subject: [PATCH] template-processor: default to material design --- Assets/Templates/fuzzel.conf | 2 +- Assets/Templates/gtk.css | 2 +- Assets/Templates/telegram.tdesktop-theme | 2 +- Assets/Translations/de.json | 3 ++- Assets/Translations/en.json | 3 ++- Assets/Translations/es.json | 3 ++- Assets/Translations/fr.json | 3 ++- Assets/Translations/hu.json | 3 ++- Assets/Translations/ja.json | 3 ++- Assets/Translations/ku.json | 3 ++- Assets/Translations/nl.json | 3 ++- Assets/Translations/pl.json | 3 ++- Assets/Translations/pt.json | 3 ++- Assets/Translations/ru.json | 3 ++- Assets/Translations/tr.json | 3 ++- Assets/Translations/uk-UA.json | 3 ++- Assets/Translations/zh-CN.json | 3 ++- Assets/Translations/zh-TW.json | 3 ++- Assets/settings-default.json | 2 +- Commons/Settings.qml | 2 +- .../Settings/Tabs/ColorScheme/ColorsSubTab.qml | 14 +++++++------- .../python/src/theming/template-processor.py | 17 ++++++++--------- Services/Theming/TemplateProcessor.qml | 4 ++-- 23 files changed, 52 insertions(+), 38 deletions(-) diff --git a/Assets/Templates/fuzzel.conf b/Assets/Templates/fuzzel.conf index aa34ef5e7..dc519a8fb 100644 --- a/Assets/Templates/fuzzel.conf +++ b/Assets/Templates/fuzzel.conf @@ -1,5 +1,5 @@ # Fuzzel Colors -# Generated with Template Processor +# Generated by Noctalia's Template Processor [colors] background={{colors.background.default.hex_stripped}}CC diff --git a/Assets/Templates/gtk.css b/Assets/Templates/gtk.css index 6305f28eb..3b0a9c454 100644 --- a/Assets/Templates/gtk.css +++ b/Assets/Templates/gtk.css @@ -1,6 +1,6 @@ /* * GTK Colors -* Generated with Template Processor +* Generated by Noctalia's Template Processor */ @define-color accent_color {{colors.primary.default.hex}}; diff --git a/Assets/Templates/telegram.tdesktop-theme b/Assets/Templates/telegram.tdesktop-theme index beebe2289..f2d9e6730 100644 --- a/Assets/Templates/telegram.tdesktop-theme +++ b/Assets/Templates/telegram.tdesktop-theme @@ -1,5 +1,5 @@ // Material You theme for Telegram Desktop -// Generated by Template Processor +// Generated by Noctalia's Template Processor COLOR_GRAY: {{colors.outline.default.hex}}; COLOR_DARK: {{colors.surface_variant.default.hex}}; diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index bc8b1649a..6b1346b01 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -453,6 +453,7 @@ "update": "Aktualisieren", "upload": "Hochladen", "version": "Version", + "vibrant": "Lebhaft", "visualizer": "Visualisierer", "volume": "Lautstärke", "volumes": "Lautstärken", @@ -773,7 +774,7 @@ "templates-write-path": "Schreibt: {filepath}", "title": "Farbschema", "wallpaper-method-description": "Wählen Sie Ihre bevorzugte Methode zur Palettengenerierung.", - "wallpaper-method-label": "Farbextraktionsmethode" + "wallpaper-method-label": "Methode zur Palettengenerierung" }, "control-center": { "cards-desc": "Passen Sie an, welche Steuerelemente im Kontrollzentrum angezeigt werden und in welcher Reihenfolge.", diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index ce06895b2..7edf2d644 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -453,6 +453,7 @@ "update": "Update", "upload": "Upload", "version": "Version", + "vibrant": "Vibrant", "visualizer": "Visualizer", "volume": "Volume", "volumes": "Volumes", @@ -773,7 +774,7 @@ "templates-write-path": "Writes: {filepath}", "title": "Color Scheme", "wallpaper-method-description": "Choose your favorite palette generation method.", - "wallpaper-method-label": "Color extraction method" + "wallpaper-method-label": "Palette generation method" }, "control-center": { "cards-desc": "Customize which controls appear in the control center and in what order.", diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index dbd456c5d..8ef93ea86 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -453,6 +453,7 @@ "update": "Actualizar", "upload": "Subir", "version": "Versión", + "vibrant": "Vibrante", "visualizer": "Visualizador", "volume": "Volumen", "volumes": "Volúmenes", @@ -773,7 +774,7 @@ "templates-write-path": "Escribe: {filepath}", "title": "Esquema de colores", "wallpaper-method-description": "Elige tu método de generación de paleta favorito.", - "wallpaper-method-label": "Método de extracción de color" + "wallpaper-method-label": "Método de generación de paleta" }, "control-center": { "cards-desc": "Personaliza qué controles aparecen en el centro de control y en qué orden.", diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index f26f0e43c..ab67d9148 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -453,6 +453,7 @@ "update": "Mise à jour", "upload": "Téléverser", "version": "Version", + "vibrant": "Vibrant", "visualizer": "Visualiseur", "volume": "Volume", "volumes": "Volumes", @@ -773,7 +774,7 @@ "templates-write-path": "Écrit : {filepath}", "title": "Jeu de couleurs", "wallpaper-method-description": "Choisissez votre méthode de génération de palette préférée.", - "wallpaper-method-label": "Méthode d'extraction des couleurs" + "wallpaper-method-label": "Méthode de génération de palette" }, "control-center": { "cards-desc": "Personnalisez les commandes qui apparaissent dans le centre de contrôle et leur ordre d'affichage.", diff --git a/Assets/Translations/hu.json b/Assets/Translations/hu.json index 0d787c42b..6e04e0514 100644 --- a/Assets/Translations/hu.json +++ b/Assets/Translations/hu.json @@ -453,6 +453,7 @@ "update": "Frissítés", "upload": "Feltöltés", "version": "Verzió", + "vibrant": "Élénk", "visualizer": "Vizualizáló", "volume": "Térfogat", "volumes": "Kötetek", @@ -773,7 +774,7 @@ "templates-write-path": "Írja: {filepath}", "title": "Színséma", "wallpaper-method-description": "Válassza ki a kedvenc palettagenerálási módszereit.", - "wallpaper-method-label": "Színkivonási módszer" + "wallpaper-method-label": "Paletta generálási módszer" }, "control-center": { "cards-desc": "Személyre szabhatja, hogy mely vezérlők jelenjenek meg a vezérlőközpontban és milyen sorrendben.", diff --git a/Assets/Translations/ja.json b/Assets/Translations/ja.json index 6d5a857a7..c5fc96274 100644 --- a/Assets/Translations/ja.json +++ b/Assets/Translations/ja.json @@ -453,6 +453,7 @@ "update": "アップデート", "upload": "アップロード", "version": "バージョン", + "vibrant": "鮮やか", "visualizer": "ビジュアライザー", "volume": "ボリューム", "volumes": "ボリューム", @@ -773,7 +774,7 @@ "templates-write-path": "書き込み先: {filepath}", "title": "配色", "wallpaper-method-description": "お好みのパレット生成方法を選択してください。", - "wallpaper-method-label": "色の抽出方法" + "wallpaper-method-label": "パレット生成方法" }, "control-center": { "cards-desc": "コントロールセンターに表示する項目と、その順序をカスタマイズします。", diff --git a/Assets/Translations/ku.json b/Assets/Translations/ku.json index ed03fad87..c8a94c9bd 100644 --- a/Assets/Translations/ku.json +++ b/Assets/Translations/ku.json @@ -453,6 +453,7 @@ "update": "Nûkirin", "upload": "Barkirin", "version": "Guherto", + "vibrant": "Geş", "visualizer": "Dîmender", "volume": "Hêjmar", "volumes": "Cild", @@ -773,7 +774,7 @@ "templates-write-path": "Dinivîse: {filepath}", "title": "Şêweya rengan", "wallpaper-method-description": "Rêbaza xweya bijarte ya hilberîna paletê hilbijêre.", - "wallpaper-method-label": "Rêbaza derxistina rengan" + "wallpaper-method-label": "Rêbaza çêkirina paletê" }, "control-center": { "cards-desc": "Xwerû bike ka kîjan kontrol di navenda kontrolê de û bi çi rêzê de xuya dibin.", diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index f3f11f1b4..d1e248e58 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -453,6 +453,7 @@ "update": "Update", "upload": "Uploaden", "version": "Versie", + "vibrant": "Levendig", "visualizer": "Visualiseerder", "volume": "Volume", "volumes": "Volumes", @@ -773,7 +774,7 @@ "templates-write-path": "Schrijft: {filepath}", "title": "Kleurschema", "wallpaper-method-description": "Kies je favoriete methode voor het genereren van paletten.", - "wallpaper-method-label": "Kleurextractiemethode" + "wallpaper-method-label": "Paletgeneratiemethode" }, "control-center": { "cards-desc": "Pas aan welke bedieningselementen in het bedieningscentrum verschijnen en in welke volgorde.", diff --git a/Assets/Translations/pl.json b/Assets/Translations/pl.json index a27e820be..540deceb6 100644 --- a/Assets/Translations/pl.json +++ b/Assets/Translations/pl.json @@ -453,6 +453,7 @@ "update": "Aktualizacja", "upload": "Wyślij", "version": "Wersja", + "vibrant": "Żywy", "visualizer": "Wizualizator", "volume": "Objętość", "volumes": "Tomy", @@ -773,7 +774,7 @@ "templates-write-path": "Zapisuje: {filepath}", "title": "Schemat kolorów", "wallpaper-method-description": "Wybierz swoją ulubioną metodę generowania palety.", - "wallpaper-method-label": "Metoda ekstrakcji kolorów" + "wallpaper-method-label": "Metoda generowania palety" }, "control-center": { "cards-desc": "Dostosuj, które kontrolki pojawiają się w centrum sterowania i w jakiej kolejności.", diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 1836582e3..dabc72354 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -453,6 +453,7 @@ "update": "Atualização", "upload": "Enviar", "version": "Versão", + "vibrant": "Vibrante", "visualizer": "Visualizador", "volume": "Volume", "volumes": "Volumes", @@ -773,7 +774,7 @@ "templates-write-path": "Escreve: {filepath}", "title": "Esquema de cores", "wallpaper-method-description": "Escolha o seu método de geração de paleta favorito.", - "wallpaper-method-label": "Método de extração de cor" + "wallpaper-method-label": "Método de geração de paleta" }, "control-center": { "cards-desc": "Personalize quais controles aparecem na central de controle e em que ordem.", diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 3d5fa98f3..3a281e544 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -453,6 +453,7 @@ "update": "Обновление", "upload": "Загрузить", "version": "Версия", + "vibrant": "Яркий", "visualizer": "Визуализатор", "volume": "Объём", "volumes": "Тома", @@ -773,7 +774,7 @@ "templates-write-path": "Записывает: {filepath}", "title": "Цветовая схема", "wallpaper-method-description": "Выберите ваш любимый метод генерации палитры.", - "wallpaper-method-label": "Метод извлечения цвета" + "wallpaper-method-label": "Метод генерации палитры" }, "control-center": { "cards-desc": "Настройте, какие элементы управления появляются в центре управления и в каком порядке.", diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index d9c7e7750..0e968046a 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -453,6 +453,7 @@ "update": "Güncelleme", "upload": "Yükle", "version": "Sürüm", + "vibrant": "Canlı", "visualizer": "Görselleştirici", "volume": "Hacim", "volumes": "Hacimler", @@ -773,7 +774,7 @@ "templates-write-path": "Yazıyor: {filepath}", "title": "Renk şeması", "wallpaper-method-description": "Favori palet oluşturma yönteminizi seçin.", - "wallpaper-method-label": "Renk çıkarma yöntemi" + "wallpaper-method-label": "Palet oluşturma yöntemi" }, "control-center": { "cards-desc": "Kontrol merkezinde hangi kontrollerin ve hangi sırada görüneceğini özelleştirin.", diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index fe54e3e94..db6dd1653 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -453,6 +453,7 @@ "update": "Оновлення", "upload": "Вивантажити", "version": "Версія", + "vibrant": "Яскравий", "visualizer": "Візуалізатор", "volume": "Об'єм", "volumes": "Обсяги", @@ -773,7 +774,7 @@ "templates-write-path": "Записує: {filepath}", "title": "Колірна схема", "wallpaper-method-description": "Оберіть свій улюблений метод створення палітри.", - "wallpaper-method-label": "Метод вилучення кольору" + "wallpaper-method-label": "Метод створення палітри" }, "control-center": { "cards-desc": "Налаштуйте, які елементи керування з'являються в центрі керування та в якому порядку.", diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 56bf80d99..c2e935767 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -453,6 +453,7 @@ "update": "更新", "upload": "上传", "version": "版本", + "vibrant": "鲜艳", "visualizer": "可视化工具", "volume": "音量", "volumes": "音量", @@ -773,7 +774,7 @@ "templates-write-path": "写入:{filepath}", "title": "配色方案", "wallpaper-method-description": "选择您喜欢的调色板生成方法。", - "wallpaper-method-label": "颜色提取方法" + "wallpaper-method-label": "调色板生成方法" }, "control-center": { "cards-desc": "自定义在控制中心显示的控制项及其顺序。", diff --git a/Assets/Translations/zh-TW.json b/Assets/Translations/zh-TW.json index a9e7f1ec1..0e3d6a56d 100644 --- a/Assets/Translations/zh-TW.json +++ b/Assets/Translations/zh-TW.json @@ -446,6 +446,7 @@ "update": "更新", "upload": "上傳", "version": "版本", + "vibrant": "鮮明", "visualizer": "視覺效果", "volume": "音量", "volumes": "音量", @@ -765,7 +766,7 @@ "templates-write-path": "寫入: {filepath}", "title": "主題配色", "wallpaper-method-description": "選擇你喜歡的配色生成方法", - "wallpaper-method-label": "色彩提取方式" + "wallpaper-method-label": "調色盤產生方法" }, "control-center": { "cards-desc": "自訂控制中心出現的控制項目及排序", diff --git a/Assets/settings-default.json b/Assets/settings-default.json index 88427dea4..5f09aeac6 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -390,7 +390,7 @@ "schedulingMode": "off", "manualSunrise": "06:30", "manualSunset": "18:30", - "extractionMethod": "default" + "generationMethod": "material" }, "templates": { "activeTemplates": [], diff --git a/Commons/Settings.qml b/Commons/Settings.qml index b96022f85..f5a33b55c 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -616,7 +616,7 @@ Singleton { property string schedulingMode: "off" property string manualSunrise: "06:30" property string manualSunset: "18:30" - property string extractionMethod: "default" + property string generationMethod: "material" } // templates toggles diff --git a/Modules/Panels/Settings/Tabs/ColorScheme/ColorsSubTab.qml b/Modules/Panels/Settings/Tabs/ColorScheme/ColorsSubTab.qml index e8712727f..adea013c2 100644 --- a/Modules/Panels/Settings/Tabs/ColorScheme/ColorsSubTab.qml +++ b/Modules/Panels/Settings/Tabs/ColorScheme/ColorsSubTab.qml @@ -215,18 +215,18 @@ ColumnLayout { enabled: Settings.data.colorSchemes.useWallpaperColors visible: Settings.data.colorSchemes.useWallpaperColors model: [ - { - "key": "default", - "name": I18n.tr("common.default") - }, { "key": "material", "name": "Material Design" // Do not translate - } + }, + { + "key": "vibrant", + "name": I18n.tr("common.vibrant") + }, ] - currentKey: Settings.data.colorSchemes.extractionMethod + currentKey: Settings.data.colorSchemes.generationMethod onSelected: key => { - Settings.data.colorSchemes.extractionMethod = key; + Settings.data.colorSchemes.generationMethod = key; AppThemeService.generate(); } } diff --git a/Scripts/python/src/theming/template-processor.py b/Scripts/python/src/theming/template-processor.py index 92cbe372a..314ed9005 100644 --- a/Scripts/python/src/theming/template-processor.py +++ b/Scripts/python/src/theming/template-processor.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Template processor - Wallpaper-based color extraction and theme generation. +Noctalia's Template processor - Wallpaper-based color extraction and theme generation. A CLI tool that extracts dominant colors from wallpaper images and generates palettes with optional templating: - Material Design 3 using HCT (Hue, Chroma, Tone) color space. @@ -10,8 +10,8 @@ Usage: python3 template-processor.py IMAGE_OR_JSON [OPTIONS] Options: - --default Generate vibrant accent-based colors (default) - --material Generate Material Design 3 colors + --material Generate Material Design 3 colors (default) + --vibrant Generate vibrant accent-based colors --dark Generate dark theme only --light Generate light theme only --both Generate both themes (default) @@ -53,7 +53,7 @@ def parse_args() -> argparse.Namespace: epilog=""" Examples: python3 template-processor.py wallpaper.png # default mode, both themes - python3 template-processor.py wallpaper.png --material --dark # material mode, dark only + python3 template-processor.py wallpaper.png --vibrant --dark # vibrant mode, dark only python3 template-processor.py wallpaper.jpg --dark -o theme.json # output to file python3 template-processor.py wallpaper.png -r tpl.txt:out.txt # render template """ @@ -71,13 +71,12 @@ Examples: style_group.add_argument( '--material', action='store_true', - help='Generate Material Design 3 colors' + help='Generate Material Design 3 colors (default)' ) style_group.add_argument( - '--default', + '--vibrant', action='store_true', - default=True, - help='Generate vibrant accent-based palette (default)' + help='Generate vibrant accent-based palette' ) # Theme mode (mutually exclusive) @@ -247,7 +246,7 @@ def main() -> int: return 1 # Generate theme for each mode - use_material = args.material + use_material = not args.vibrant for mode in modes: result[mode] = generate_theme(palette, mode, use_material) diff --git a/Services/Theming/TemplateProcessor.qml b/Services/Theming/TemplateProcessor.qml index 2bc19515e..51a6e26b2 100644 --- a/Services/Theming/TemplateProcessor.qml +++ b/Services/Theming/TemplateProcessor.qml @@ -262,7 +262,7 @@ Singleton { script += `NOCTALIA_WP_PATH=$(cat << '${wpDelimiter}'\n${wallpaper}\n${wpDelimiter}\n)\n`; // Use template-processor.py (Python implementation) - const styleFlag = (Settings.data.colorSchemes.extractionMethod === "default") ? "--default" : "--material"; + const styleFlag = (Settings.data.colorSchemes.generationMethod === "vibrant") ? "--vibrant" : "--material"; // We pass --type for compatibility but it is ignored by internal logic unless needed script += `python3 "${templateProcessorScript}" "$NOCTALIA_WP_PATH" ${styleFlag} --config '${pathEsc}' --mode ${mode} `; @@ -363,7 +363,7 @@ Singleton { // Otherwise, use single quotes for safety with file paths const inputQuoted = input.startsWith("$") ? `"${input}"` : `'${input.replace(/'/g, "'\\''")}'`; - const styleFlag = (Settings.data.colorSchemes.extractionMethod === "default") ? "--default" : "--material"; + const styleFlag = (Settings.data.colorSchemes.generationMethod === "vibrant") ? "--vibrant" : "--material"; script += ` python3 "${templateProcessorScript}" ${inputQuoted} ${styleFlag} --config '${userConfigPath}' --mode ${mode}\n`; script += "fi";