fix(ipc): don't format empty strings (#2549)

* fix(ipc): don't format empty strings

* Add a description of the change to `CHANGELOG.md`

* Rephrasing
This commit is contained in:
Jean-Luc Bastarache 2021-11-04 11:55:16 -04:00 committed by GitHub
parent 9b5611af3f
commit 542f70efa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -168,6 +168,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `include-directory` and `include-file` now support relative paths. The paths - `include-directory` and `include-file` now support relative paths. The paths
are relative to the folder of the file where those directives appear. are relative to the folder of the file where those directives appear.
([`#2523`](https://github.com/polybar/polybar/issues/2523)) ([`#2523`](https://github.com/polybar/polybar/issues/2523))
- `custom/ipc`: Empty output strings are no longer formatted. This prevents
extraneous spaces and separators from appearing in the bar when the output of
an ipc module is empty.
### Fixed ### Fixed
- `custom/script`: Concurrency issues with fast-updating tailed scripts. - `custom/script`: Concurrency issues with fast-updating tailed scripts.

View File

@ -90,6 +90,9 @@ namespace modules {
// the format prefix/suffix also gets wrapper // the format prefix/suffix also gets wrapper
// with the cmd handlers // with the cmd handlers
string output{module::get_output()}; string output{module::get_output()};
if (output.empty()) {
return "";
}
for (auto&& action : m_actions) { for (auto&& action : m_actions) {
if (!action.second.empty()) { if (!action.second.empty()) {