fix(cava): default data_format to ascii for correct bar scaling

data_format was changed from always "ascii" to user-configurable,
but without a default. This caused cava to use "binary", calculating
height as 65535 instead of ascii_range, making bars always peak.
This commit is contained in:
Xavier Ruiz
2025-12-27 18:00:38 -05:00
parent 06484547d1
commit 19bb89874e

View File

@@ -183,10 +183,10 @@ void waybar::modules::cava::CavaBackend::loadConfig() {
prm_.inAtty = 0; prm_.inAtty = 0;
auto const output{prm_.output}; auto const output{prm_.output};
// prm_.output = ::cava::output_method::OUTPUT_RAW; // prm_.output = ::cava::output_method::OUTPUT_RAW;
if (config_["data_format"].isString()) { if (prm_.data_format) free(prm_.data_format);
if (prm_.data_format) free(prm_.data_format); // Default to ascii for format-icons output; allow user override
prm_.data_format = strdup(config_["data_format"].asString().c_str()); prm_.data_format = strdup(
} config_["data_format"].isString() ? config_["data_format"].asString().c_str() : "ascii");
if (config_["raw_target"].isString()) { if (config_["raw_target"].isString()) {
if (prm_.raw_target) free(prm_.raw_target); if (prm_.raw_target) free(prm_.raw_target);
prm_.raw_target = strdup(config_["raw_target"].asString().c_str()); prm_.raw_target = strdup(config_["raw_target"].asString().c_str());