cava bump: 0.10.2

Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
This commit is contained in:
Viktar Lukashonak
2024-05-23 16:14:06 +03:00
parent 35a9ca476d
commit 60a613ae51
3 changed files with 6 additions and 17 deletions

View File

@ -8,18 +8,7 @@ waybar::modules::Cava::Cava(const std::string& id, const Json::Value& config)
char cfgPath[PATH_MAX];
cfgPath[0] = '\0';
if (config_["cava_config"].isString()) {
std::string strPath{config_["cava_config"].asString()};
const std::string fnd{"XDG_CONFIG_HOME"};
const std::string::size_type npos{strPath.find("$" + fnd)};
if (npos != std::string::npos) {
if (const char* xdg = getenv(fnd.c_str()))
strPath.replace(npos, fnd.length() + 1, xdg);
else
spdlog::warn("Module {0}. Environment variable \"${1}\" not found", name_, fnd);
}
strcpy(cfgPath, strPath.data());
}
if (config_["cava_config"].isString()) strcpy(cfgPath, config_["cava_config"].asString().data());
// Load cava config
error_.length = 0;