Skip to content
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

Support fractional percentages #50

Open
bbarenblat opened this issue May 12, 2020 · 0 comments · May be fixed by #51
Open

Support fractional percentages #50

bbarenblat opened this issue May 12, 2020 · 0 comments · May be fixed by #51

Comments

@bbarenblat
Copy link
Contributor

It would be great if I could pass fractional percentage values to brightnessctl – e.g., brightnessctl set 0.5%. It looks like all the percentage calculations occur on the FPU anyway, so this could probably be done simply by changing value.val to be a float and using strtof to parse it.

bbarenblat added a commit to bbarenblat/brightnessctl that referenced this issue May 13, 2020
Treat values passed on the command line as floats instead of longs.
This allows you to specify fractional percentages (and fractional
absolute values, too, though they’ll just be rounded down, so they’re
not particularly useful).

Report the display brightness as a percentage with two decimal places
rather than zero. To ensure backward compatibility in machine-readable
mode, report the high-precision percentage in a new field rather than
replacing the existing field. This does cause some redundancy in the
output, but that’s better than breaking scripts that assume the 4th
field is an integer followed by “%”.

Closes: Hummer12007#50
@bbarenblat bbarenblat linked a pull request May 13, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant