diff --git a/src/modules/wireplumber.cpp b/src/modules/wireplumber.cpp index a43ad29b..d04edd18 100644 --- a/src/modules/wireplumber.cpp +++ b/src/modules/wireplumber.cpp @@ -436,7 +437,7 @@ auto waybar::modules::Wireplumber::update() -> void { label_.get_style_context()->remove_class("source-muted"); } - int vol = round(volume_ * 100.0); + double vol = 20 * std::log10(volume_); // % to dB int source_vol = round(source_volume_ * 100.0); // Get the state and apply state-specific format if available @@ -450,7 +451,7 @@ auto waybar::modules::Wireplumber::update() -> void { } // Prepare source format string (similar to PulseAudio) - std::string format_source = "{volume}%"; + std::string format_source = "{volume}dB"; if (source_muted_) { if (config_["format-source-muted"].isString()) { format_source = config_["format-source-muted"].asString();