| Commit message (Collapse) | Author | Age |
|
|
|
| |
Rewritten some contributed code
|
|
|
|
|
|
|
|
| |
added -e / --exponent.
As the perceived brightness change from 10% to 20% is not the same as 90% to 100%,
there is now a float parameter--exponent / -e to set the mapping of the percentage form linear (as it was) to polynominal.
(%=x^k*max*100^-k)
k is the value that you can change now.
|
| |
|
| |
|
| |
|
|
|
| |
closes #24
|
| |
|
| |
|
|
|
|
|
|
| |
fallback to /tmp
closes #22
|
| |
|
|
|
|
|
|
|
|
| |
* Added flag never-zero that stops brightness being set to 0.
* Updated README to show never-zero flag.
* Replaced never-zero with min-value flag
|
| |
|
| |
|
|
|
|
| |
thanks @SirCmpwn
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Specifying it before may cause issues with some compilers
Minor ws cleanup in makefile
|
| |
|
|
|
|
|
| |
Use the file mode 0755 (executable but not suid) when installing the binary
with INSTALL_UDEV_RULES=1.
|
|
|
|
|
|
|
|
|
|
| |
fixes #10
added an option to install udev rules (fixes #11)
updated makefile to adhere to DESTDIR/PREFIX conventions
updated README
|
| |
|
| |
|
|
|
|
| |
There should be an option to get a sole "current brightness" value.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Dead link on AUR.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Restore device data only after successful read
Do not set curr_brightness to max after an unsuccessful restore
Fix ensure_dir
Do not ignore ignore value of fread (fixes #6)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Add static specifier to functions
|
| |
|
| |
|
|\
| |
| | |
Various fixes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Print an error message if the run directory or the device-class
subdirectory exists but is not a directory.
Before:
% rm -rf /tmp/brightnessctl
% touch /tmp/brightnessctl
% brightnessctl -s
Device 'intel_backlight' of class 'backlight':
Current brightness: 1000 (20%)
Max brightness: 4794
% file /tmp/brightnessctl
/tmp/brightnessctl: empty
%
After:
% brightnessctl -s
Error saving device data: Not a directory
Could not save data for device 'intel_backlight'.
Device 'intel_backlight' of class 'backlight':
Current brightness: 1000 (20%)
Max brightness: 4794
%
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make several changes to error handling:
• Check for negative values from sprintf, and treat them as errors.
• Check for errors from fscanf both by comparing its return value against
EOF and by checking ferror.
• Avoiding calling perror with errno set to -1. Either set a meaningful
value, such as EINVAL, or use fprintf if errno cannot be expected to
have a meaningful value.
• Instead of re-using errno for internal error handling, use a new variable
to indicate errors where it makes sense to do so.
• In read_device, print more specific error messages if we fail to read
a device's current or max brightness, and print an error message
immediately if a read fails, instead of only maybe at the end of
read_device.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Do not write a trailing NUL byte to the state file.
Before:
% brightnessctl -ms
intel_backlight,backlight,1000,20%,4794
% od -t x1z /tmp/brightnessctl/backlight/intel_backlight
0000000 31 30 30 30 00 >1000.<
0000005
%
After:
% brightnessctl -ms
intel_backlight,backlight,1000,20%,4794
% od -t x1z /tmp/brightnessctl/backlight/intel_backlight
0000000 31 30 30 30 >1000<
0000004
%
Note that restore still works:
% brightnessctl -mr
intel_backlight,backlight,1000,20%,4794
%
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When creating the /tmp/brightnessctl directory or its subdirectories, clear
errno before calling mkdir, and call stat a second time after mkdir.
Previously, errno was not cleared, so even if the error was handled (by
creating the missing directory with mkdir), subsequent error handling code
read the old errno value from the failed stat call and printed an error
message.
Additionally, because we did not call stat again after calling mkdir, the
stat buffer had outdated information, and so S_ISDIR returned a false
negative.
As a result of these defects, invoking brightnessctl -s when
/tmp/brightnessctl did not exist would create /tmp/brightnessctl and fail.
Invoking brightnessctl -s a second time would create
/tmp/brightnessctl/backlight and fail. Invoking the command a third time
would succeed and write the state file under /tmp/brightnessctl/backlight/.
After this commit, brightnessctl -s succeeds the first time.
|
| |
| |
| |
| |
| |
| | |
The -r/--restore flag requires root, the same as the set verb does, so
print an error message if either the flag or the verb is used without
running as root.
|