Crates.io | backlight_control_rs |
lib.rs | backlight_control_rs |
version | 1.0.0 |
source | src |
created_at | 2024-12-01 14:57:25.527963 |
updated_at | 2024-12-01 14:57:25.527963 |
description | Backlight control is a re-written version of [backlight_control](https://github.com/Hendrikto/backlight_control/) with a few key improvements. |
homepage | |
repository | https://github.com/DOD-101/backlight_control_rs |
max_upload_size | |
id | 1467553 |
size | 31,391 |
Backlight control is a re-written version of backlight_control with a few key improvements.
There are a few reasons:
The original backlight_control sets the backlight dir at compile time in the make file. The problem with this is that it makes it impossible to be cached in package repositories. backlight_control_rs determines this information at runtime, meaning caching is possible.
backlight_control_rs comes with a library, so that other projects can easily adjust the backlight brightness as well.
backlight_control_rs has made a few QOL changes compared to the original: better help message, --stats
option, absolute and relative adjustments
backlight_control doesn't work on NixOs due to how it's written. backlight_control_rs addresses this.
light
?light is also a good alternative, however I personally very much enjoyed the high degree of simplicity of backlight_control. Light offers many more features than I ever needed, hence backlight_control was the clear choice. It did what I needed and nothing more.
And backlight_control_rs has all the simplicity of backlight_control, without any of the troubles.
As for other options, they either fall into the same category as light in having too much, or needing X-server to work.
backlight_control_rs +50 # increase brightness by 50
backlight_control_rs -50 # reduce brightness by 50
backlight_control_rs 50 # set brightness to 50
NOTE: These values are absolute. They do not adjust as n%
as with backlight_control.
To do this, append a %
:
backlight_control_rs +50% # increase brightness by 50%
backlight_control_rs -50% # reduce brightness by 50%
backlight_control_rs 50% # set brightness to 50%
You can run with -s
to print information about the backlight, rather than making adjustments.
You can use cargo install
, however, this method is less desirable than installing via your package manager.
WIP
WIP
The original backlight_control used permissions to allow anyone to run the binary as root.
This made it possible to change the backlight brightness without any further configuration.
This approach doesn't work on NixOs however, since files in /nix/store
can't have their permissions set in this way.
This is what most other programs do to handle this issue.
By using a udev rule to change the ownership of the brightness
file to the video
group any user in that group, can change the backlight brightness.
This is also the reason why you should use a package manager rather than cargo install, sine the permissions won't be handled for you.
This project is licensed under either of
at your option.
Its inspiration comes in no small part from backlight_control and light.