From 4088c13eec49527b8997bf7cc72ac6c6dbcfaf1b Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Fri, 14 Nov 2025 13:27:54 +0100 Subject: [PATCH] AudioService: preserve input value (fixes 0% volume after suspend... hopefully) autoformat --- Services/Media/AudioService.qml | 8 ++++---- Services/Theming/TemplateProcessor.qml | 2 +- Services/Theming/TemplateRegistry.qml | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Services/Media/AudioService.qml b/Services/Media/AudioService.qml index 60526eb3..9cb25a78 100644 --- a/Services/Media/AudioService.qml +++ b/Services/Media/AudioService.qml @@ -53,12 +53,12 @@ Singleton { var vol = source.audio.volume if (vol !== undefined && !isNaN(vol)) { root._inputVolume = vol - } else { - root._inputVolume = 0 } + // Don't reset to 0 if volume is undefined/NaN - preserve last known value root._inputMuted = !!source.audio.muted } else { - root._inputVolume = 0 + // Don't reset volume to 0 when source is unavailable - preserve last known value + // Only reset muted state root._inputMuted = true } } @@ -102,7 +102,7 @@ Singleton { function onVolumeChanged() { var vol = source?.audio?.volume if (vol === undefined || isNaN(vol)) { - root._inputVolume = 0 + // Don't reset to 0 if volume is undefined/NaN - preserve last known value return } // Only update if the value actually changed to prevent spurious signals diff --git a/Services/Theming/TemplateProcessor.qml b/Services/Theming/TemplateProcessor.qml index 9992bf1b..ba0400f1 100644 --- a/Services/Theming/TemplateProcessor.qml +++ b/Services/Theming/TemplateProcessor.qml @@ -235,7 +235,7 @@ Singleton { const templatePath = `${Quickshell.shellDir}/Assets/MatugenTemplates/${codeApp.input}` const outputPath = client.path.replace("~", homeDir) const outputDir = outputPath.substring(0, outputPath.lastIndexOf('/')) - + // Extract base config directory for checking var baseConfigDir = "" if (client.name === "code") { diff --git a/Services/Theming/TemplateRegistry.qml b/Services/Theming/TemplateRegistry.qml index 24da2974..2a9d2e6b 100644 --- a/Services/Theming/TemplateRegistry.qml +++ b/Services/Theming/TemplateRegistry.qml @@ -142,8 +142,7 @@ Singleton { "path": "~/.config/Vencord", "requiresThemesFolder": false }] - }, - { + }, { "id": "code", "name": "VSCode", "category": "applications",