diff --git a/Assets/MatugenTemplates/cava.ini b/Assets/MatugenTemplates/cava.ini new file mode 100644 index 00000000..909c886f --- /dev/null +++ b/Assets/MatugenTemplates/cava.ini @@ -0,0 +1,16 @@ +[color] +background = '{{colors.surface.default.hex}}' +foreground = '{{colors.primary.default.hex}}' + +gradient = 1 +gradient_color_1 = '{{colors.primary_container.default.hex}}' +gradient_color_2 = '{{colors.primary.default.hex}}' +gradient_color_3 = '{{colors.on_primary_container.default.hex}}' + +horizontal_gradient = 0 +horizontal_gradient_color_1 = '{{colors.primary_container.default.hex}}' +horizontal_gradient_color_2 = '{{colors.primary.default.hex}}' +horizontal_gradient_color_3 = '{{colors.on_primary_container.default.hex}}' +horizontal_gradient_color_4 = '{{colors.primary.default.hex}}' +horizontal_gradient_color_5 = '{{colors.primary_container.default.hex}}' + diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index e4ffceb3..82af9292 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -1071,6 +1071,10 @@ "description": "Schreibe {filepath}.", "description-missing": "Benötigt die Installation von {app}" }, + "cava": { + "description": "Schreibe {filepath}.", + "description-missing": "Benötigt die Installation von {app}" + }, "vicinae": { "description": "Schreibt {filepath} und lädt neu", "description-missing": "Erfordert die Installation von {app}" diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 90c86a42..39783217 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -1071,6 +1071,10 @@ "description": "Write {filepath}.", "description-missing": "Requires {app} to be installed" }, + "cava": { + "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 4890862b..23e6086f 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -1071,6 +1071,10 @@ "description": "Escribe {filepath}.", "description-missing": "Requiere que {app} esté instalado/a." }, + "cava": { + "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 bcecc238..95433471 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -1071,6 +1071,10 @@ "description": "Écrire {filepath}.", "description-missing": "Nécessite l'installation de {app}" }, + "cava": { + "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 91e5841e..669d2ea6 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -1071,6 +1071,10 @@ "description": "Schrijf {filepath}.", "description-missing": "Vereist dat {app} is geïnstalleerd." }, + "cava": { + "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 19d85780..8f66cdb5 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -1071,6 +1071,10 @@ "description": "Escreva em {filepath}.", "description-missing": "Requer que o {app} esteja instalado." }, + "cava": { + "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 9035a04d..e0f882e2 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -1071,6 +1071,10 @@ "description": "Записать {filepath}.", "description-missing": "Требуется установка {app}" }, + "cava": { + "description": "Записать {filepath}.", + "description-missing": "Требуется установка {app}" + }, "vicinae": { "description": "Записать {filepath} и перезагрузить", "description-missing": "Требуется установка {app}" diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index e397922b..c0d5d982 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -1071,6 +1071,10 @@ "description": "{filepath} dosyasına yaz.", "description-missing": "Kurulum için {app} gereklidir" }, + "cava": { + "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 2dc22bec..08efe119 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -1071,6 +1071,10 @@ "description": "Записати {filepath}.", "description-missing": "Потрібна установка {app}" }, + "cava": { + "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 f6fe649d..60faab70 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -1071,6 +1071,10 @@ "description": "写入 {filepath}。", "description-missing": "需要安装 {app}" }, + "cava": { + "description": "写入 {filepath}。", + "description-missing": "需要安装 {app}" + }, "vicinae": { "description": "写入 {filepath} 并重新加载", "description-missing": "需要安装 {app}" diff --git a/Bin/colors-apply.sh b/Bin/colors-apply.sh index 0c4bff32..d6733fc7 100755 --- a/Bin/colors-apply.sh +++ b/Bin/colors-apply.sh @@ -4,7 +4,7 @@ if [ "$#" -ne 1 ]; then # Print usage information to standard error. echo "Error: No application specified." >&2 - echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox}" >&2 + echo "Usage: $0 {kitty|ghostty|foot|alacritty|wezterm|fuzzel|walker|pywalfox|cava}" >&2 exit 1 fi @@ -200,6 +200,42 @@ pywalfox) pywalfox update ;; +cava) + echo "🎨 Applying 'noctalia' theme to cava..." + CONFIG_FILE="$HOME/.config/cava/config" + + # Check if the config file exists. + if [ -f "$CONFIG_FILE" ]; then + # Check if [color] section exists + if grep -q '^\[color\]' "$CONFIG_FILE"; then + echo "[color] section found, checking theme setting..." + + # Check if theme is already set to noctalia under [color] + if sed -n '/^\[color\]/,/^\[/p' "$CONFIG_FILE" | grep -q '^theme = "noctalia"'; then + echo "Theme already set to noctalia under [color], skipping modification." + else + # Check if theme line exists under [color] section + if sed -n '/^\[color\]/,/^\[/p' "$CONFIG_FILE" | grep -q '^theme = '; then + # Replace existing theme line under [color] + sed -i '/^\[color\]/,/^\[/{s/^theme = .*/theme = "noctalia"/}' "$CONFIG_FILE" + else + # Add theme line after [color] + sed -i '/^\[color\]/a theme = "noctalia"' "$CONFIG_FILE" + fi + fi + else + echo "[color] section not found, adding it with theme..." + # Add [color] section with theme at the end of file + echo "" >>"$CONFIG_FILE" + echo "[color]" >>"$CONFIG_FILE" + echo 'theme = "noctalia"' >>"$CONFIG_FILE" + fi + else + echo "Error: cava config file not found at $CONFIG_FILE" >&2 + exit 1 + fi + ;; + *) # Handle unknown application names. echo "Error: Unknown application '$APP_NAME'." >&2 diff --git a/Commons/Settings.qml b/Commons/Settings.qml index ea422a7e..02fe889f 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -508,6 +508,7 @@ Singleton { property bool code: false property bool spicetify: false property bool telegram: false + property bool cava: false property bool enableUserTemplates: false } diff --git a/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml b/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml index 1839d5e6..fc92cbb0 100644 --- a/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml +++ b/Modules/Panels/Settings/Tabs/ColorScheme/ColorSchemeTab.qml @@ -853,6 +853,24 @@ ColumnLayout { } } } + + NCheckbox { + label: "Cava" + description: ProgramCheckerService.cavaAvailable ? I18n.tr("settings.color-scheme.templates.programs.cava.description", { + "filepath": "~/.config/cava/themes/noctalia" + }) : I18n.tr("settings.color-scheme.templates.programs.cava.description-missing", { + "app": "cava" + }) + checked: Settings.data.templates.cava + enabled: ProgramCheckerService.cavaAvailable + opacity: ProgramCheckerService.cavaAvailable ? 1.0 : 0.6 + onToggled: checked => { + if (ProgramCheckerService.cavaAvailable) { + Settings.data.templates.cava = checked; + AppThemeService.generate(); + } + } + } } // Miscellaneous NCollapsible { diff --git a/Services/System/ProgramCheckerService.qml b/Services/System/ProgramCheckerService.qml index a0c9d644..a3d0e701 100644 --- a/Services/System/ProgramCheckerService.qml +++ b/Services/System/ProgramCheckerService.qml @@ -28,6 +28,7 @@ Singleton { property bool gnomeCalendarAvailable: false property bool spicetifyAvailable: false property bool telegramAvailable: false + property bool cavaAvailable: false // Discord client auto-detection property var availableDiscordClients: [] @@ -183,7 +184,8 @@ Singleton { "codeAvailable": ["which", "code"], "gnomeCalendarAvailable": ["which", "gnome-calendar"], "spicetifyAvailable": ["which", "spicetify"], - "telegramAvailable": ["which", "telegram-desktop"] + "telegramAvailable": ["which", "telegram-desktop"], + "cavaAvailable": ["which","cava"] }) // Internal tracking diff --git a/Services/Theming/TemplateRegistry.qml b/Services/Theming/TemplateRegistry.qml index 4322ba44..a15b3033 100644 --- a/Services/Theming/TemplateRegistry.qml +++ b/Services/Theming/TemplateRegistry.qml @@ -208,6 +208,18 @@ Singleton { } ], "postProcess": () => `spicetify -q apply --no-restart` + }, + { + "id": "cava", + "name": "Cava", + "category": "applications", + "input": "cava.ini", + "outputs": [ + { + "path": "~/.config/cava/themes/noctalia" + } + ], + "postProcess": () => `${colorsApplyScript} cava` } ]