Full-featured Linux utility to control backlight brightness.
-
Install Rust
Follow the official Rust installation guide to install Rust on your system.
-
Clone the Repository
Open a terminal and run:
git clone https://github.com/geekylthyosaur/slight.git cd slight
-
Install Required Dependencies
Ensure the following development libraries are installed:
- On Debian/Ubuntu based systems
libdbus-1-dev
andlibudev-dev
. - On Fedora based systems
dbus-devel
andlibudev-devel
.
- On Debian/Ubuntu based systems
-
Build the project
Compile the project in release mode with:
cargo build --release
-
Locate the binary
Compiled binary will be available at:
target/release/slight
-
Just type your
[INPUT]
, and now you have absolute control over your device's brightness. Set an exact value usingn
, or make incremental adjustments with+n
or-n
. Want a relative setting? Use percentages, liken%
, or change it relatively with+n%
or-n%
. And guess what? Then
can even be a floating-point number! -
The
--id <ID>
option allows you to tailor the brightness to specific device. Easily identify and select device using the next feature. -
Curious about the devices at your disposal? Use
--list [<LIST>...]
to unveil all available devices or view specific ones by providing their IDs. -
Ever noticed how adjusting brightness from 0% to 5% feels like turning on a spotlight, while going from 95% to 100% is barely noticeable? It's all because of how our eyes work! But no worries, I've got your back with an awesome solution – introducing the
--exponent [<EXPONENT>]
option! Now, you can fine-tune brightness like a boss! This mode makes sure the brightness changes are consistent, making both the 0% to 5% and 95% to 100% transitions equally noticeable. Don't give any specific exponent? I've got the default value of4.0
set up for you! So go ahead, play with those illuminating exponentials and enjoy the perfect glow! -
Choose your preferred destination for brightness adjustments. Whether you want to keep an eye on the changes in your terminal or utilize system file operations, we've got you covered with the
--stdout
option. -
Sometimes, you just need a quick change. The
--toggle [<TOGGLE>]
option lets you switch between just two available values (0/1). No fuss, no complexity - just swift toggling. Moreover, we've enriched this feature with the ability to specify the possible values as on or off. -
For those who crave knowledge, the
--verbose
option sheds light on every action the CLI takes. Stay informed and enjoy the transparency. -
Feeling a little lost? Use
--help
for a quick summary of the commands and options at your disposal. -
Wondering which version you're using? A quick
--version
will reveal the current version, keeping you informed and up-to-date.
To manage kernel sysfs
permissions for backlight control, follow one of these options:
- Place the
90-backlight.rules
file into/etc/udev/rules.d/
or another location for udev rules on your system. - Ensure your user belongs to the
video
group. - Reload udev rules or reboot your system.
If your system uses elogind
or systemd-logind
, no additional configuration is needed.