i3 / i3status

Generates status bar to use with i3bar, dzen2 or xmobar
BSD 3-Clause "New" or "Revised" License
598 stars 251 forks source link

[496 Battery module incorrectly trims whitespace] #515

Closed ghost closed 8 months ago

ghost commented 1 year ago

496

Note: I believe the initial intent of the trimming was to remove spaces due to empty values such as in this example: %remaining having no value when the battery is at 100%.

It creates a tailing space, which was in the formatting, made by the user, to separate the last two parameters.

format: ... %status %remaining result: ... [status value][space][empty string here due to no value]

Although, even with the trimming, an empty value right in the middle of a set of %parameters will still make empty spaces.

I tested the claim other modules not trimning and it was the true. In other words, the trimming did not fix anything and it was causing this module to behave abnormally.