1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2025-11-06 22:34:39 -05:00

feat(github): Option to hide notification count if empty

This commit is contained in:
Michael Carlberg 2016-12-20 05:53:45 +01:00
parent 6ef1721b61
commit de04fa3eac
2 changed files with 4 additions and 2 deletions

View file

@ -21,7 +21,8 @@ namespace modules {
*/
void github_module::setup() {
m_accesstoken = m_conf.get<string>(name(), "token");
m_interval = m_conf.get<chrono::seconds>(name(), "interval", 60s);
m_interval = m_conf.get(name(), "interval", 60s);
m_empty_notifications = m_conf.get(name(), "empty-notifications", m_empty_notifications);
m_formatter->add(DEFAULT_FORMAT, TAG_LABEL, {TAG_LABEL});
@ -57,7 +58,7 @@ namespace modules {
if (m_label) {
m_label->reset_tokens();
m_label->replace_token("%notifications%", to_string(notifications));
m_label->replace_token("%notifications%", notifications || m_empty_notifications ? to_string(notifications) : "");
}
return true;