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

Revamp #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Revamp #1

wants to merge 7 commits into from

Conversation

tricantivu
Copy link

@tricantivu tricantivu commented Jul 5, 2023

Previously (i.e commit 9a79e0d),
backlight_control would not validate the value argument and set unexpected brightness values.

For example:

backlight_control -100

Sets the current brigthness to 0.

Although Linux ensures the value set in /sys/class/backlight/<backlight>/brightness is between 0 and max_brightness, I think it would be nice to notify the user of invalid arguments.

Thanks for reading and I am open to feedback.

@Hendrikto
Copy link
Owner

Hi Alejandro,

Thanks for your interest and contribution :)

I agree with the technical changes (like ab68af5), but I don't want to change the coding style (e.g. 2b2725d). Are you fine with cherry-picking just some of the commits from your branch?

Best,
Hendrik

@tricantivu
Copy link
Author

tricantivu commented Jul 6, 2023

I am fine with that @Hendrikto

Edit 1:

What do you think about replacing the conditional expression ((value < 0 ? value *= -1 : value)) for labs function from stdlib header?

if (labs(value) >= 1 && labs(value) <= 100)

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 this pull request may close these issues.

None yet

2 participants