Skip to content

geekylthyosaur/slight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slight

Full-featured Linux utility to control backlight brightness.

Build

  1. Install Rust

    Follow the official Rust installation guide to install Rust on your system.

  2. Clone the Repository

    Open a terminal and run:

    git clone https://github.com/geekylthyosaur/slight.git
    cd slight
  3. Install Required Dependencies

    Ensure the following development libraries are installed:

    • On Debian/Ubuntu based systems libdbus-1-dev and libudev-dev.
    • On Fedora based systems dbus-devel and libudev-devel.
  4. Build the project

    Compile the project in release mode with:

    cargo build --release
  5. Locate the binary

    Compiled binary will be available at:

    target/release/slight
    

Features

  • Just type your [INPUT], and now you have absolute control over your device's brightness. Set an exact value using n, or make incremental adjustments with +n or -n. Want a relative setting? Use percentages, like n%, or change it relatively with +n% or -n%. And guess what? The n 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 of 4.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.

Permissions

To manage kernel sysfs permissions for backlight control, follow one of these options:

Option 1: Set Up udev Rules

  1. Place the 90-backlight.rules file into /etc/udev/rules.d/ or another location for udev rules on your system.
  2. Ensure your user belongs to the video group.
  3. Reload udev rules or reboot your system.

Option 2: Use elogind or systemd-logind

If your system uses elogind or systemd-logind, no additional configuration is needed.

About

Full-featured Linux utility to control backlight brightness

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages