mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
apply clang-format
This commit is contained in:
parent
0898236586
commit
1ca660460a
@ -10,7 +10,6 @@
|
||||
|
||||
waybar::modules::Temperature::Temperature(const std::string& id, const Json::Value& config)
|
||||
: ALabel(config, "temperature", id, "{temperatureC}°C", 10) {
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
// try to read sysctl?
|
||||
#else
|
||||
@ -84,12 +83,12 @@ float waybar::modules::Temperature::getTemperature() {
|
||||
auto sysctl_thermal = fmt::format("hw.acpi.thermal.tz{}.temperature", zone);
|
||||
|
||||
if (sysctlbyname(sysctl_thermal.c_str(), &temp, &size, NULL, 0) != 0) {
|
||||
throw std::runtime_error(fmt::format("sysctl {} failed",sysctl_thermal));
|
||||
throw std::runtime_error(fmt::format("sysctl {} failed", sysctl_thermal));
|
||||
}
|
||||
auto temperature_c = ((float)temp-2732)/10;
|
||||
auto temperature_c = ((float)temp - 2732) / 10;
|
||||
return temperature_c;
|
||||
|
||||
#else // Linux
|
||||
#else // Linux
|
||||
std::ifstream temp(file_path_);
|
||||
if (!temp.is_open()) {
|
||||
throw std::runtime_error("Can't open " + file_path_);
|
||||
|
Loading…
Reference in New Issue
Block a user