mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
PR #1485 review
This commit is contained in:
parent
9f337db2d2
commit
6946288053
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
waybar::modules::Temperature::Temperature(const std::string& id, const Json::Value& config)
|
waybar::modules::Temperature::Temperature(const std::string& id, const Json::Value& config)
|
||||||
: ALabel(config, "temperature", id, "{temperatureC}°C", 10) {
|
: ALabel(config, "temperature", id, "{temperatureC}°C", 10) {
|
||||||
if (config_["format"].asString().empty() && config_["format-critical"].asString().empty()) {
|
|
||||||
throw std::runtime_error("Format configuration is not defined");
|
|
||||||
} else if (config_["format"].asString().empty()) {
|
|
||||||
format_.clear();
|
|
||||||
}
|
|
||||||
if (config_["hwmon-path"].isString()) {
|
if (config_["hwmon-path"].isString()) {
|
||||||
file_path_ = config_["hwmon-path"].asString();
|
file_path_ = config_["hwmon-path"].asString();
|
||||||
} else if (config_["hwmon-path-abs"].isString() && config_["input-filename"].isString()) {
|
} else if (config_["hwmon-path-abs"].isString() && config_["input-filename"].isString()) {
|
||||||
@ -40,8 +35,7 @@ auto waybar::modules::Temperature::update() -> void {
|
|||||||
label_.get_style_context()->remove_class("critical");
|
label_.get_style_context()->remove_class("critical");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(format.empty())
|
if(format.empty()) {
|
||||||
{
|
|
||||||
event_box_.hide();
|
event_box_.hide();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user