refactor(pulseaudio): fallback to default muted format

This commit is contained in:
Alex 2020-03-25 22:53:09 +01:00
parent c302116e73
commit 9acf5587fa
1 changed files with 5 additions and 1 deletions

View File

@ -216,6 +216,10 @@ auto waybar::modules::Pulseaudio::update() -> void {
label_.get_style_context()->remove_class("bluetooth"); label_.get_style_context()->remove_class("bluetooth");
} }
if (muted_) { if (muted_) {
// Check muted bluetooth format exist, otherwise fallback to default muted format
if (format_name != "format" && !config_[format_name + "-muted"].isString()) {
format_name = "format";
}
format_name = format_name + "-muted"; format_name = format_name + "-muted";
label_.get_style_context()->add_class("muted"); label_.get_style_context()->add_class("muted");
} else { } else {