Fix clang-format to src/modules/temperature.cpp

pull/3011/head
Nicola Revelant 2024-03-15 17:12:31 +01:00
parent fbf66530a3
commit 01ff7ebb36
1 changed files with 4 additions and 3 deletions

View File

@ -102,9 +102,10 @@ float waybar::modules::Temperature::getTemperature() {
auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0;
if (sysctlbyname(fmt::format("hw.acpi.thermal.tz{}.temperature", zone).c_str(), &temp, &size, NULL, 0) != 0) {
throw std::runtime_error(
fmt::format("sysctl hw.acpi.thermal.tz{}.temperature or dev.cpu.{}.temperature failed", zone, zone));
if (sysctlbyname(fmt::format("hw.acpi.thermal.tz{}.temperature", zone).c_str(), &temp, &size,
NULL, 0) != 0) {
throw std::runtime_error(fmt::format(
"sysctl hw.acpi.thermal.tz{}.temperature or dev.cpu.{}.temperature failed", zone, zone));
}
auto temperature_c = ((float)temp - 2732) / 10;
return temperature_c;