diff --git a/src/modules/temperature.cpp b/src/modules/temperature.cpp index e888109..935fea3 100644 --- a/src/modules/temperature.cpp +++ b/src/modules/temperature.cpp @@ -3,10 +3,7 @@ #include #if defined(__FreeBSD__) -// clang-format off -#include #include -// clang-format on #endif waybar::modules::Temperature::Temperature(const std::string& id, const Json::Value& config) @@ -80,6 +77,9 @@ float waybar::modules::Temperature::getTemperature() { int temp; size_t size = sizeof temp; + auto zone = config_["thermal-zone"].isInt() ? config_["thermal-zone"].asInt() : 0; + auto sysctl_thermal = fmt::format("hw.acpi.thermal.tz{}.temperature", zone); + if (sysctlbyname("hw.acpi.thermal.tz0.temperature", &temp, &size, NULL, 0) != 0) { throw std::runtime_error( "sysctl hw.acpi.thermal.tz0.temperature or dev.cpu.0.temperature failed");