thinkpad-backlight-api

Crates.iothinkpad-backlight-api
lib.rsthinkpad-backlight-api
version0.1.0
sourcesrc
created_at2024-12-29 03:35:28.504506+00
updated_at2024-12-29 03:35:28.504506+00
descriptionKeyboard backlight API for thinkpad
homepagehttps://github.com/vlad2030/thinkpad-backlight-api
repositoryhttps://github.com/vlad2030/thinkpad-backlight-api
max_upload_size
id1497930
size16,099
vladops (Vlad2030)

documentation

README

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)
Commit count: 0

cargo fmt