diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbf5150..c50feeb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 KB/s (as before), 1 for MB/s and 2 for GB/s. ### Fixed +- Trailing space after the layout label when indicators are empty and made sure right amount + of spacing is added between the indicator labels, in the xkeyboard module. + ([`#2292`](https://github.com/polybar/polybar/issues/2292)) - Parser error if click command contained `}` ([`#2040`](https://github.com/polybar/polybar/issues/2040)) diff --git a/src/modules/xkeyboard.cpp b/src/modules/xkeyboard.cpp index cdceccb7..ebfa9a74 100644 --- a/src/modules/xkeyboard.cpp +++ b/src/modules/xkeyboard.cpp @@ -191,10 +191,12 @@ namespace modules { } else if (tag == TAG_LABEL_INDICATOR && !m_indicators.empty()) { size_t n{0}; for (auto&& indicator : m_indicators) { - if (n++) { - builder->space(m_formatter->get(DEFAULT_FORMAT)->spacing); + if (*indicator.second) { + if (n++) { + builder->space(m_formatter->get(DEFAULT_FORMAT)->spacing); + } + builder->node(indicator.second); } - builder->node(indicator.second); } return n > 0; } else {