Merge pull request #4908 from 7FM/master

pulseaudio: add target option to control source (microphone) volume
This commit is contained in:
Alexis Rouillard
2026-07-03 23:12:36 +02:00
committed by GitHub
7 changed files with 102 additions and 29 deletions
+5 -1
View File
@@ -7,6 +7,10 @@ waybar::modules::Pulseaudio::Pulseaudio(const std::string& id, const Json::Value
backend = util::AudioBackend::getInstance([this] { this->dp.emit(); });
backend->setIgnoredSinks(config_["ignored-sinks"]);
if (config_["target"].isString() && config_["target"].asString() == "source") {
target = util::PulseaudioTarget::Source;
}
}
bool waybar::modules::Pulseaudio::handleScroll(GdkEventScroll* e) {
@@ -33,7 +37,7 @@ bool waybar::modules::Pulseaudio::handleScroll(GdkEventScroll* e) {
? util::ChangeType::Increase
: util::ChangeType::Decrease;
backend->changeVolume(change_type, step, max_volume);
backend->changeVolume(change_type, step, max_volume, target);
return true;
}
+1 -1
View File
@@ -53,7 +53,7 @@ void PulseaudioSlider::onValueChanged() {
if (unmute_on_volume_change) {
backend->unmute(target);
}
backend->changeVolume(slider_value, min_, max_);
backend->changeVolume(slider_value, min_, max_, target);
}
}