From 34ff56ae19dbfa91a6ad7f233a5a3b8efd96f136 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Mon, 18 May 2026 21:51:21 -0400 Subject: [PATCH] Detect PipeWire playback streams by sink role --- shell/plugins/bar/widgets/audioPanel.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/shell/plugins/bar/widgets/audioPanel.qml b/shell/plugins/bar/widgets/audioPanel.qml index f609f0f2..f3321c30 100644 --- a/shell/plugins/bar/widgets/audioPanel.qml +++ b/shell/plugins/bar/widgets/audioPanel.qml @@ -55,12 +55,18 @@ Item { // Identify true playback streams without reading node.properties here: // PwNode.properties is invalid until the node is bound, and reading it while // capture streams are appearing (for example, when Voxtype starts recording) - // can destabilize Quickshell's Pipewire service. `type` mirrors media.class - // and is safe enough for pre-bind filtering. + // can destabilize Quickshell's Pipewire service. Quickshell versions differ + // in how `type` is exposed (media.class, enum name, or numeric enum), but + // playback streams consistently accept audio input from clients and publish + // `isSink: true`; capture streams publish as stream sources. function isPlaybackStream(node) { - if (!node) return false + if (!node || !node.isStream) return false + if (node.isSink === true) return true + var mediaClass = String(node.type || "") - return mediaClass.indexOf("Output") !== -1 + return mediaClass.indexOf("Stream/Output/Audio") !== -1 + || mediaClass.indexOf("AudioOutStream") !== -1 + || mediaClass.indexOf("Output") !== -1 } readonly property var audioSinks: {