Add light support to backlight module #749
Open
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.
This PR introduces support to Light (https://github.com/haikarainen/light) support in
backlight
module, as a alternative program to control backlight. It uses sysfs files and udev rules instead of through a X protocol likexbacklight
, so it works in non-X environments (for example, insway
). Also, it seems more reliable and works wherexbacklight
does not work (like when usingxf86-modesetting
instead ofxf86-video-intel
driver).It is already supported in the official repositories in multiple distros (like Arch, Fedora and NixOS), so it seems to be a much better supported alternative than other programs that do something similar (like https://github.com/wavexx/acpilight/).
Since this needs to be explicitly set by the user now, I removed the check for the binary. If the user sets
adjust_method
to eitherxbacklight
orlight
, it just assumes that eitherxbacklight
orlight
is installed. However, setting it wrong does not bring any problems either (except the inability to change brightness, of course).This PR also allows the user to set
format_no_backlight
to empty string and hide backlight module in case the system does not have a backlight (i.e.:, again, in a Desktop). If you set to an empty string nowadays it results the same output as the default one, resulting in something like Brightness: -1 output.Substitutes PR #747.