Add config option to ignore Pulseaudio Sinks

Fixes #1347
This commit is contained in:
Isaac Woods 2022-07-27 01:12:34 +01:00
parent e58f1fd3e0
commit faf8954712
1 changed files with 9 additions and 0 deletions

View File

@ -170,6 +170,15 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context * /*context*/, const pa_
if (i == nullptr) return;
auto pa = static_cast<waybar::modules::Pulseaudio *>(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;