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

Fix Raise/lower brightness by specific amount #78

Closed
wants to merge 5 commits into from

Conversation

trollLemon
Copy link
Contributor

This PR resolves #68, where the --brightness +n|-n option ignored the prefixes of the given number and running set instead of raise/lower.

What I changed is the following:

  • Instead of parsing a u8 for the brightness, parse an i8 (for negative numbers)
  • Extra conditional logic: if we parsed the number to an i8, check the original string:
    • If the string doesn't contain a + or -, we call the set brightness function with the i8.
    • If the string does contain a + or -, we check if the number is positive or negative and call the raise or lower brightness
      function.

I've tested the brightness functionality on my machine, and it works correctly.

Let me know if I need to change anything.

@ErikReider
Copy link
Owner

Superseded by #67. Please reopen if there's anything that the other PR was missing compared to this :)

@ErikReider ErikReider closed this Apr 15, 2024
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.

Raise/lower brightness by specific amount
2 participants