diff --git a/include/modules/github.hpp b/include/modules/github.hpp index 79080cc8..4c45c80a 100644 --- a/include/modules/github.hpp +++ b/include/modules/github.hpp @@ -24,6 +24,7 @@ namespace modules { label_t m_label{}; string m_accesstoken{}; unique_ptr m_http{}; + bool m_empty_notifications{false}; }; } diff --git a/src/modules/github.cpp b/src/modules/github.cpp index 18491059..0daaf51c 100644 --- a/src/modules/github.cpp +++ b/src/modules/github.cpp @@ -21,7 +21,8 @@ namespace modules { */ void github_module::setup() { m_accesstoken = m_conf.get(name(), "token"); - m_interval = m_conf.get(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;