Skip to content

Commit 8c6063d

Browse files
authoredMar 19, 2022
Merge pull request #1485 from LukashonakV/master
Hide/Unhide temperature module when "format*" is empty.
2 parents 799125f + 6946288 commit 8c6063d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/modules/temperature.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ auto waybar::modules::Temperature::update() -> void {
3434
} else {
3535
label_.get_style_context()->remove_class("critical");
3636
}
37+
38+
if(format.empty()) {
39+
event_box_.hide();
40+
return;
41+
} else {
42+
event_box_.show();
43+
}
44+
3745
auto max_temp = config_["critical-threshold"].isInt() ? config_["critical-threshold"].asInt() : 0;
3846
label_.set_markup(fmt::format(format,
3947
fmt::arg("temperatureC", temperature_c),

0 commit comments

Comments
 (0)