#backlight #linux #thinkpad

thinkpad-backlight-api

Keyboard backlight API for thinkpad

1 unstable release

0.1.0 Dec 29, 2024

#308 in Operating systems

Download history 100/week @ 2024-12-25 8/week @ 2025-01-01 8/week @ 2025-01-08

116 downloads per month

Apache-2.0

6KB
65 lines

thinkpad-backlight-api

Keyboard backlight API for thinkpad. Implemented on Rust

How to use

Add a crate

Add this to your Cargo.toml:

thinkpad-backlight-api = "0.1.0"

Example usage

use thinkpad_backlight_api::{KeyboardBacklight, LightLevel};

fn main() {
    if let Err(e) = KeyboardBacklight::set(LightLevel::Full) {
        println!("Error: {:?}", e)
    }

    match KeyboardBacklight::get() {
        Ok(level) => println!("Level: {:?}", level),
        Err(e) => println!("Error: {:?}", e),
    }
}

Tested on

  • Lenovo thinkpad 480s (Ubuntu 24.04)

Dependencies

~43KB