Skip to content

fix: percent_print respects use_spacer when pad_percents is unset#2330

Open
riteshdhurwey wants to merge 1 commit intobrndnmtthws:mainfrom
riteshdhurwey:fix/percent-print-spacer-width
Open

fix: percent_print respects use_spacer when pad_percents is unset#2330
riteshdhurwey wants to merge 1 commit intobrndnmtthws:mainfrom
riteshdhurwey:fix/percent-print-spacer-width

Conversation

@riteshdhurwey
Copy link
Copy Markdown

Problem

use_spacer = 'left' was ignored for ${cpu} and other percentage
values when pad_percents was not explicitly set.

Root Cause

percent_print() passed pad_percents (default: 0) as width to
spaced_print(). A width of 0 means no padding, so spacer had no effect.

Fix

Default width to 3 when pad_percents is unset, since percentage
values are always 1-3 digits (0-100).

Testing

Tested on Arch Linux with use_spacer = 'left':
Before: CPU: 5% CPU: 14% (inconsistent width)
After: CPU: 5% CPU: 14% (consistent width)

Closes #2078

When pad_percents is 0 (default), use a width of 3 so that
use_spacer = 'left' and 'right' work correctly for percentage
values like cpu, battery, etc.

Fixes brndnmtthws#2078
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 10, 2026

Deploy Preview for conkyweb canceled.

Name Link
🔨 Latest commit b136ec9
🔍 Latest deploy log https://app.netlify.com/projects/conkyweb/deploys/69b01951240b8400085abb78

@github-actions github-actions bot added the sources PR modifies project sources label Mar 10, 2026
@brndnmtthws brndnmtthws added the LLM Likely LLM slop label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM Likely LLM slop sources PR modifies project sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "cpu" is not affected by "use_spacer = 'left'"

2 participants