From faf8954712f8276c3196c5eda2622e4ad554fb2c Mon Sep 17 00:00:00 2001 From: Isaac Woods Date: Wed, 27 Jul 2022 01:12:34 +0100 Subject: [PATCH] Add config option to ignore Pulseaudio Sinks Fixes #1347 --- src/modules/pulseaudio.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/pulseaudio.cpp b/src/modules/pulseaudio.cpp index 24b858d3..43af2b19 100644 --- a/src/modules/pulseaudio.cpp +++ b/src/modules/pulseaudio.cpp @@ -170,6 +170,15 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context * /*context*/, const pa_ if (i == nullptr) return; auto pa = static_cast(data); + + if (pa->config_["ignored-sinks"].isArray()) { + for (const auto& ignored_sink : pa->config_["ignored-sinks"]) { + if (ignored_sink.asString() == i->description) { + return; + } + } + } + if (pa->current_sink_name_ == i->name) { if (i->state != PA_SINK_RUNNING) { pa->current_sink_running_ = false;