-
-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to adjust power consumption format replacement field precision #2963
Comments
I think making an option to configure the number of decimals is not necessary. I'll make a PR to always shows two decimals. |
That should translate to |
You could use padright() from the string library in Lua, but that might have some limitations if your generated text is larger than your field width so choose wisely. |
@alebastr sadly it does not, this seems to have no effect at all.
@jramrath i think it might be good to have the option, as some people may be short on waybar space and want to only show one or even no decimals. But I think showing only two by default may still be an improvement. Do you know where in the codebase the format string interpolation is done, and whether it would be reasonably easy to implement an option for number of decimals? (something like |
I see now that waybar uses the {fmt} library for label formatting. Given the official example for how |
Nevermind this. I was simply changing the value of the |
current behavior
the
{power}
(power in watts) format replacement can take up a variable amount of characters, which sometimes leads to a shorter or longer character count for the battery module on my waybar:better behavior
allow the user to specify the amount of decimal places so that character count stays constant (essentially something like
%4.2f
inprintf
)The text was updated successfully, but these errors were encountered: