-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide/Unhide temperature module when "format*" is empty. #1485
Conversation
src/modules/temperature.cpp
Outdated
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(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think that useful
src/modules/temperature.cpp
Outdated
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(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think that useful
src/modules/temperature.cpp
Outdated
if(format.empty()) | ||
{ | ||
event_box_.hide(); | ||
return; | ||
} else { | ||
event_box_.show(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just lint and we'll be good :)
src/modules/temperature.cpp
Outdated
if(format.empty()) | ||
{ | ||
event_box_.hide(); | ||
return; | ||
} else { | ||
event_box_.show(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just lint and we'll be good :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Please check the new one commit :)
Thanks! |
Actually even is set
"format" : ""
waybar displays some spaces. But when user wants to have the only notification when temperature threshold is triggered it looks not so good.Current fix does:
"format" : ""
neither"format-critical" : ""
is defined - throw an exception in order to have temperature module disabled during the start processconfig example: