From 0f650b36f77aab0c714e4198588032c231b89b23 Mon Sep 17 00:00:00 2001 From: Aiser <2912778691@qq.com> Date: Sat, 22 Nov 2025 14:52:38 +0800 Subject: [PATCH] Matugen: Add Telegram's Theme --- .../MatugenTemplates/telegram.tdesktop-theme | 139 ++++++++++++++++++ Assets/Translations/de.json | 6 +- Assets/Translations/en.json | 4 + Assets/Translations/es.json | 4 + Assets/Translations/fr.json | 4 + Assets/Translations/nl.json | 4 + Assets/Translations/pt.json | 4 + Assets/Translations/ru.json | 4 + Assets/Translations/tr.json | 4 + Assets/Translations/uk-UA.json | 4 + Assets/Translations/zh-CN.json | 4 + Commons/Settings.qml | 1 + .../Tabs/ColorScheme/ColorSchemeTab.qml | 18 +++ Services/System/ProgramCheckerService.qml | 4 +- Services/Theming/TemplateRegistry.qml | 11 ++ 15 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 Assets/MatugenTemplates/telegram.tdesktop-theme diff --git a/Assets/MatugenTemplates/telegram.tdesktop-theme b/Assets/MatugenTemplates/telegram.tdesktop-theme new file mode 100644 index 00000000..70854823 --- /dev/null +++ b/Assets/MatugenTemplates/telegram.tdesktop-theme @@ -0,0 +1,139 @@ +// Material You theme for Telegram Desktop +// Generated by matugen + +COLOR_GRAY: {{colors.outline.default.hex}}; +COLOR_DARK: {{colors.surface_variant.default.hex}}; + +windowBg: {{colors.background.default.hex}}; // Main background +windowFg: {{colors.on_background.default.hex}}; // Main text +windowBgOver: {{colors.surface_variant.default.hex}}; // Generic background on hover +windowBgRipple: {{colors.surface_variant.default.hex}}; // Ripple effect +windowFgOver: {{colors.on_surface_variant.default.hex}}; // Text on hover +windowSubTextFg: {{colors.outline.default.hex}}; // Minor text +windowSubTextFgOver: {{colors.outline.default.hex}}; // Minor text on hover +windowBoldFg: {{colors.on_background.default.hex}}; // Bold text +windowBoldFgOver: {{colors.on_surface_variant.default.hex}}; // Bold text on hover +windowBgActive: {{colors.primary.default.hex}}; // Active items background +windowFgActive: {{colors.on_primary.default.hex}}; // Active items text +windowActiveTextFg: {{colors.primary.default.hex}}; // Active items text +windowShadowFg: {{colors.shadow.default.hex}}; // Window shadow +windowShadowFgFallback: {{colors.shadow.default.hex}}; // Fallback for shadow +historyOutIconFg: {{colors.primary.default.hex}}; +historyIconFgInverted: {{colors.on_surface.default.hex}}; + +msgServiceBg: {{colors.primary_container.default.hex}}; +msgServiceFg: {{colors.on_surface.default.hex}}; +msgOutBg: {{colors.primary_container.default.hex}}; +msgOutBgSelected : {{colors.tertiary_container.default.hex}}; +msgOutServiceFg: {{colors.on_surface.default.hex}}; +msgOutDateFg: {{colors.on_surface.default.hex}}; +historySentIconFg: {{colors.on_surface.default.hex}}; +msgOutDateFgSelected: {{colors.on_surface.default.hex}}; +msgDateImgFg: {{colors.on_surface.default.hex}}; +dialogsSentIconFg: {{colors.primary.default.hex}}; +dialogsSentIconFgOver: {{colors.primary.default.hex}}; +dialogsOnlineBadgeFg: {{colors.primary.default.hex}}; + + +shadowFg: {{colors.shadow.default.hex}}; // General shadow +slideFadeOutBg: {{colors.background.default.hex}}; +slideFadeOutShadowFg: {{colors.shadow.default.hex}}; + +imageBg: {{colors.surface.default.hex}}; +imageBgTransparent: {{colors.surface.default.hex}}; + +activeButtonBg: {{colors.primary.default.hex}}; // Active button background +activeButtonBgOver: {{colors.primary_container.default.hex}}; // Active button hover background +activeButtonBgRipple: {{colors.on_primary_container.default.hex}}; // Active button ripple +activeButtonFg: {{colors.on_primary.default.hex}}; // Active button text +activeButtonFgOver: {{colors.on_primary_container.default.hex}}; // Active button hover text +activeButtonSecondaryFg: {{colors.on_primary.default.hex}}; // Active button secondary text +activeButtonSecondaryFgOver: {{colors.on_primary_container.default.hex}}; // Active button secondary hover text +activeLineFg: {{colors.on_surface.default.hex}}; +dialogsBgActive: {{colors.primary.default.hex}}; + +lightButtonBg: {{colors.surface.default.hex}}; // Light button background +lightButtonBgOver: {{colors.surface_variant.default.hex}}; // Light button hover background +lightButtonBgRipple: {{colors.primary.default.hex}}; // Light button ripple +lightButtonFg: {{colors.on_surface.default.hex}}; // Light button text +lightButtonFgOver: {{colors.on_surface_variant.default.hex}}; // Light button hover text + +attentionButtonFg: {{colors.error.default.hex}}; +attentionButtonFgOver: {{colors.error.default.hex}}; +attentionButtonBgOver: {{colors.error_container.default.hex}}; +attentionButtonBgRipple: {{colors.on_error_container.default.hex}}; + +outlineButtonBg: {{colors.surface.default.hex}}; // Outline button background +outlineButtonBgOver: {{colors.surface_variant.default.hex}}; // Outline button hover background +outlineButtonOutlineFg: {{colors.primary.default.hex}}; // Outline button color +outlineButtonBgRipple: {{colors.primary.default.hex}}; // Outline button ripple + +menuBg: {{colors.surface.default.hex}}; +menuBgOver: {{colors.surface_variant.default.hex}}; +menuBgRipple: {{colors.primary.default.hex}}; +menuIconFg: {{colors.on_surface.default.hex}}; +menuIconFgOver: {{colors.on_surface_variant.default.hex}}; +menuSubmenuArrowFg: {{colors.outline.default.hex}}; +menuFgDisabled: {{colors.outline.default.hex}}; +menuSeparatorFg: {{colors.outline.default.hex}}; + +scrollBarBg: {{colors.primary.default.hex}}40; // Scroll bar background (40% opacity) +scrollBarBgOver: {{colors.primary.default.hex}}60; // Scroll bar hover background (60% opacity) +scrollBg: {{colors.surface_variant.default.hex}}40; // Scroll bar track (40% opacity) +scrollBgOver: {{colors.surface_variant.default.hex}}60; // Scroll bar track on hover (60% opacity) + +smallCloseIconFg: {{colors.outline.default.hex}}; +smallCloseIconFgOver: {{colors.on_surface_variant.default.hex}}; + +radialFg: {{colors.primary.default.hex}}; +radialBg: {{colors.surface.default.hex}}; + +placeholderFg: {{colors.outline.default.hex}}; // Placeholder text +placeholderFgActive: {{colors.primary.default.hex}}; // Active placeholder text +inputBorderFg: {{colors.outline.default.hex}}; // Input border +filterInputBorderFg: {{colors.outline.default.hex}}; // Search input border +filterInputInactiveBg: {{colors.surface.default.hex}}; // Inactive search input background +checkboxFg: {{colors.primary.default.hex}}; // Checkbox color + +titleBg: {{colors.surface.default.hex}}; // Window title background +titleShadow: {{colors.shadow.default.hex}}; +titleButtonFg: {{colors.on_surface.default.hex}}; // Title button color +titleButtonBgOver: {{colors.surface_variant.default.hex}}; // Title button hover background +titleButtonFgOver: {{colors.on_surface_variant.default.hex}}; // Title button hover color +titleButtonCloseBgOver: {{colors.error.default.hex}}; +titleButtonCloseFgOver: {{colors.on_error.default.hex}}; +titleFgActive: {{colors.on_surface.default.hex}}; // Active title text +titleFg: {{colors.on_surface.default.hex}}; // Inactive title text + +trayCounterBg: {{colors.error.default.hex}}; // Tray counter background +trayCounterBgMute: {{colors.outline.default.hex}}; // Muted tray counter background +trayCounterFg: {{colors.on_error.default.hex}}; // Tray counter text +trayCounterBgMacInvert: {{colors.error.default.hex}}; // Mac tray counter +trayCounterFgMacInvert: {{colors.on_error.default.hex}}; // Mac tray counter text + +layerBg: {{colors.surface.default.hex}}99; // Layer background (60% opacity) + +cancelIconFg: {{colors.error.default.hex}}; // Cancel icon +cancelIconFgOver: {{colors.error.default.hex}}; // Cancel icon on hover + +boxBg: {{colors.surface.default.hex}}; // Box background +boxTextFg: {{colors.on_surface.default.hex}}; // Box text +boxTextFgGood: {{colors.primary.default.hex}}; // Box good text +boxTextFgError: {{colors.error.default.hex}}; // Box error text +boxTitleFg: {{colors.on_surface.default.hex}}; // Box title text +boxSearchBg: {{colors.surface.default.hex}}; // Box search field background +boxSearchCancelIconFg: {{colors.error.default.hex}}; // Box search cancel icon +boxSearchCancelIconFgOver: {{colors.error.default.hex}}; // Box search cancel icon on hover + +contactsBg: {{colors.surface.default.hex}}; // Contacts background +contactsBgOver: {{colors.surface_variant.default.hex}}; // Contacts background on hover +contactsNameFg: {{colors.on_surface.default.hex}}; // Contact name +contactsStatusFg: {{colors.outline.default.hex}}; // Contact status +contactsStatusFgOver: {{colors.on_surface_variant.default.hex}}; // Contact status on hover +contactsStatusFgOnline: {{colors.primary.default.hex}}; // Online contact status + +photoCropFadeBg: {{colors.surface.default.hex}}cc; // Photo crop fade background +photoCropPointFg: {{colors.primary.default.hex}}; // Photo crop points + +chat_inBubbleSelected: #313244; // inbox selected chat background +chat_outBubbleSelected: #313244; // outbox selected chat background diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 28a127cc..2e2b7139 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1041,7 +1041,11 @@ "description-missing": "Erfordert die Installation von {app}" }, "spicetify": { - "description": "Schreibe {Dateipfad}. Das Comfy-Theme muss manuell installiert und aktiviert werden", + "description": "Schreibe {filepath}. Das Comfy-Theme muss manuell installiert und aktiviert werden", + "description-missing": "Benötigt die Installation von {app}" + }, + "telegram": { + "description": "Schreibe {filepath}.", "description-missing": "Benötigt die Installation von {app}" }, "vicinae": { diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 424f2974..abbb6d56 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1044,6 +1044,10 @@ "description": "Write {filepath}. Comfy theme needs to be installed and activated manually.", "description-missing": "Requires {app} to be installed" }, + "telegram": { + "description": "Write {filepath}.", + "description-missing": "Requires {app} to be installed" + }, "vicinae": { "description": "Write {filepath} and reload", "description-missing": "Requires {app} to be installed" diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index b677803a..ba6925eb 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1044,6 +1044,10 @@ "description": "Escribe {filepath}. El tema Comfy debe ser instalado y activado manualmente.", "description-missing": "Requiere que {app} esté instalado/a." }, + "telegram": { + "description": "Escribe {filepath}.", + "description-missing": "Requiere que {app} esté instalado/a." + }, "vicinae": { "description": "Escribir {filepath} y recargar", "description-missing": "Requiere que {app} esté instalado" diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 372e5a2a..070c6398 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1044,6 +1044,10 @@ "description": "Écrire {filepath}. Le thème Comfy doit être installé et activé manuellement.", "description-missing": "Nécessite l'installation de {app}" }, + "telegram": { + "description": "Écrire {filepath}.", + "description-missing": "Nécessite l'installation de {app}" + }, "vicinae": { "description": "Écrire {filepath} et recharger", "description-missing": "Nécessite que le lanceur {app} soit installé" diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index cee09441..1d39b78c 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -1044,6 +1044,10 @@ "description": "Schrijf {filepath}. Het Comfy-thema moet handmatig worden geïnstalleerd en geactiveerd.", "description-missing": "Vereist dat {app} is geïnstalleerd." }, + "telegram": { + "description": "Schrijf {filepath}.", + "description-missing": "Vereist dat {app} is geïnstalleerd." + }, "vicinae": { "description": "Schrijf {filepath} en herlaad.", "description-missing": "Vereist dat {app} is geïnstalleerd." diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 27622da3..6608c975 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1044,6 +1044,10 @@ "description": "Escreva em {filepath}. O tema Comfy precisa ser instalado e ativado manualmente.", "description-missing": "Requer que o {app} esteja instalado." }, + "telegram": { + "description": "Escreva em {filepath}.", + "description-missing": "Requer que o {app} esteja instalado." + }, "vicinae": { "description": "Escrever {filepath} e recarregar", "description-missing": "Requer que o {app} esteja instalado" diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index 58862aa7..37857b4b 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -1044,6 +1044,10 @@ "description": "Записать {filepath}. Тему Comfy нужно установить и активировать вручную.", "description-missing": "Требуется установка {app}" }, + "telegram": { + "description": "Записать {filepath}.", + "description-missing": "Требуется установка {app}" + }, "vicinae": { "description": "Записать {filepath} и перезагрузить", "description-missing": "Требуется установка {app}" diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 7b902047..34356679 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1044,6 +1044,10 @@ "description": "{filepath} dosyasına yaz. Comfy temasının kurulu ve manuel olarak etkinleştirilmiş olması gerekir.", "description-missing": "Kurulum için {app} gereklidir" }, + "telegram": { + "description": "{filepath} dosyasına yaz.", + "description-missing": "Kurulum için {app} gereklidir" + }, "vicinae": { "description": "{filepath} dosyasına yaz ve yeniden yükle", "description-missing": "Kurulum için {app} gereklidir" diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index c20ff7a8..32bc7240 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1044,6 +1044,10 @@ "description": "Записати {filepath}. Тему Comfy потрібно встановити та активувати вручну.", "description-missing": "Потрібна установка {app}" }, + "telegram": { + "description": "Записати {filepath}.", + "description-missing": "Потрібна установка {app}" + }, "vicinae": { "description": "Записати {filepath} та перезавантажити", "description-missing": "Потрібна установка {app}" diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 98c641ef..796b8d2c 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1044,6 +1044,10 @@ "description": "写入 {filepath}。Comfy 主题需要手动安装和激活。", "description-missing": "需要安装 {app}" }, + "telegram": { + "description": "写入 {filepath}。", + "description-missing": "需要安装 {app}" + }, "vicinae": { "description": "写入 {filepath} 并重新加载", "description-missing": "需要安装 {app}" diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 2c03167c..7b60773f 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -506,6 +506,7 @@ Singleton { property bool walker: false property bool code: false property bool spicetify: false + property bool telegram: false property bool enableUserTemplates: false } diff --git a/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml b/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml index 3fdf9609..124aa4c6 100644 --- a/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml +++ b/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml @@ -835,6 +835,24 @@ ColumnLayout { } } } + + NCheckbox { + label: "Telegram" + description: ProgramCheckerService.telegramAvailable ? I18n.tr("settings.color-scheme.templates.programs.telegram.description", { + "filepath": "~/.config/telegram-desktop/themes/noctalia.tdesktop-theme" + }) : I18n.tr("settings.color-scheme.templates.programs.telegram.description-missing", { + "app": "telegram" + }) + checked: Settings.data.templates.telegram + enabled: ProgramCheckerService.telegramAvailable + opacity: ProgramCheckerService.telegramAvailable ? 1.0 : 0.6 + onToggled: checked => { + if (ProgramCheckerService.telegramAvailable) { + Settings.data.templates.telegram = checked; + AppThemeService.generate(); + } + } + } } // Miscellaneous NCollapsible { diff --git a/Services/System/ProgramCheckerService.qml b/Services/System/ProgramCheckerService.qml index 7974a753..a0c9d644 100644 --- a/Services/System/ProgramCheckerService.qml +++ b/Services/System/ProgramCheckerService.qml @@ -27,6 +27,7 @@ Singleton { property bool codeAvailable: false property bool gnomeCalendarAvailable: false property bool spicetifyAvailable: false + property bool telegramAvailable: false // Discord client auto-detection property var availableDiscordClients: [] @@ -181,7 +182,8 @@ Singleton { "wlsunsetAvailable": ["which", "wlsunset"], "codeAvailable": ["which", "code"], "gnomeCalendarAvailable": ["which", "gnome-calendar"], - "spicetifyAvailable": ["which", "spicetify"] + "spicetifyAvailable": ["which", "spicetify"], + "telegramAvailable": ["which", "telegram-desktop"] }) // Internal tracking diff --git a/Services/Theming/TemplateRegistry.qml b/Services/Theming/TemplateRegistry.qml index 4322ba44..c9721cb3 100644 --- a/Services/Theming/TemplateRegistry.qml +++ b/Services/Theming/TemplateRegistry.qml @@ -208,6 +208,17 @@ Singleton { } ], "postProcess": () => `spicetify -q apply --no-restart` + }, + { + "id": "telegram", + "name": "Telegram", + "category": "applications", + "input": "telegram.tdesktop-theme", + "outputs": [ + { + "path": "~/.config/telegram-desktop/themes/noctalia.tdesktop-theme" + } + ] } ]