diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 381f69d..9e8a106 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -3853,13 +3853,38 @@ in // widget. null when no stream matches. function streamFor(player) { if (!player) return null; - let id = (player.identity || "").toLowerCase(); + // Apps are inconsistent about which property carries their + // name — Spotify doesn't fill application.name the way + // browsers do — so try every property that plausibly + // holds it, against both MPRIS names. Candidates shorter + // than 3 chars are skipped: substring matching on those + // matches almost anything. + let want = []; + let add = s => { + s = (s || "").toLowerCase(); + if (s.length >= 3) want.push(s); + }; + add(player.identity); + add(player.desktopEntry); + let ns = Pipewire.nodes.values; for (let i = 0; i < ns.length; i++) { let n = ns[i]; if (!n.isStream || !n.audio) continue; - let an = (n.properties["application.name"] || "").toLowerCase(); - if (an && (an === id || an.includes(id) || id.includes(an))) return n; + let p = n.properties; + let cands = [ + p["application.name"], + p["node.name"], + p["application.process.binary"] + ]; + for (let c = 0; c < cands.length; c++) { + let an = (cands[c] || "").toLowerCase(); + if (an.length < 3) continue; + for (let w = 0; w < want.length; w++) { + if (an === want[w] || an.includes(want[w]) || want[w].includes(an)) + return n; + } + } } return null; } @@ -4137,8 +4162,14 @@ in Rectangle { id: eqBar required property int index + // cava hears the whole output mix, + // not this stream, so a paused + // card must flatten its own ring — + // otherwise every card dances to + // whatever else is playing. readonly property real lvl: - index < calPopup.levels.length + (mediaCard.modelData.isPlaying + && index < calPopup.levels.length) ? calPopup.levels[index] / 100 : 0 width: 3 radius: 1.5 @@ -4164,67 +4195,36 @@ in width: vinyl.discSize height: vinyl.discSize radius: width / 2 - color: Theme.base02 + color: Theme.base01 - // Art-less fallback: an actual record - // rather than a flat placeholder, so - // a source with no MediaSession - // artwork (Jellyfin's web player, a - // plain