From 640a4339db26a6e017d67fa3f5d389595615fcdd Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Tue, 23 Sep 2025 08:37:16 -0400 Subject: [PATCH] Cava: Now only runs when a visualizer is in sight. --- Services/BarService.qml | 24 ++++++++++++++++++++++++ Services/BarWidgetRegistry.qml | 4 ++-- Services/CavaService.qml | 9 ++++++--- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/Services/BarService.qml b/Services/BarService.qml index 9fc6749b..96c5f2f1 100644 --- a/Services/BarService.qml +++ b/Services/BarService.qml @@ -1,11 +1,32 @@ pragma Singleton +import QtQuick import Quickshell import qs.Commons Singleton { id: root + property bool hasAudioVisualizer: false + + // Simple timer that run once when the widget structure has changed + // and determine if any MediaMini widget has the visualizer on + Timer { + id: timerCheckVisualizer + interval: 100 + repeat: false + onTriggered: { + hasAudioVisualizer = false + const widgets = getAllWidgetInstances("MediaMini") + for(var i=0; i