Limit to max_brightness, some clean up, add some TODOs#1
Open
ematsumiya wants to merge 1 commit intoDzejrou:masterfrom
Open
Limit to max_brightness, some clean up, add some TODOs#1ematsumiya wants to merge 1 commit intoDzejrou:masterfrom
ematsumiya wants to merge 1 commit intoDzejrou:masterfrom
Conversation
- Although I don't know the behaviour if value goes above max_brightness, doesn't hurt to check. - Changed some variable names for better understanding :P - Add some TODOs to README and code
Author
This was supposed to be in a next PR hehe I was working on a way to use "twbl inc/dec" arguments rather than relying on user to know what value to use, but gave up mid way because the way it is currently is more flexible. |
Dzejrou
requested changes
May 27, 2019
Owner
Dzejrou
left a comment
There was a problem hiding this comment.
How dare you rename my variables >:(
Fix the whitespace and newline issues, then LGTM.
| * TODO: save these strings in a file maybe? | ||
| */ | ||
| std::string fname{"/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness"}; | ||
| std::string max_fname{"/sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/max_brightness"}; |
Owner
There was a problem hiding this comment.
The whitespace in this PR does not match the original, tabs vs spaces.
|
|
||
| if ((current_value + val) > max_value) | ||
| { | ||
| std::cerr << "Invalid input value: " << val << " is greater than max value " << max_value; |
Owner
There was a problem hiding this comment.
Missing newline at the end of the error message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although I don't know the behaviour if value goes above max_brightness, doesn't
hurt to check.
Changed some variable names for better understanding :P
Add some TODOs to README and code
--
Update after commit:
If input value is greater than max_brightness, writing to the brightness file will fail with "invalid argument".