#ddc #ddc-ci

ddc-enhanced-rs

DDC/CI high level library for Rust (cross platform)

29 releases (stable)

Uses new Rust 2021

1.2.7 Jun 19, 2022
1.2.0 Jun 18, 2022
1.1.2 Apr 18, 2022
0.1.5 Apr 16, 2022
0.1.1 Mar 30, 2022

#31 in Windows APIs

Download history 13/week @ 2022-03-24 28/week @ 2022-03-31 8/week @ 2022-04-07 275/week @ 2022-04-14 36/week @ 2022-04-21 105/week @ 2022-04-28 97/week @ 2022-05-05 263/week @ 2022-05-12 65/week @ 2022-05-19 51/week @ 2022-05-26 189/week @ 2022-06-02 23/week @ 2022-06-09 233/week @ 2022-06-16 30/week @ 2022-06-23

491 downloads per month

MIT license

17KB
419 lines

ddc-enhanced-rs

ddc-enhanced-rs is a cross platform Rust crate and Node package for controlling monitors with DDC/CI.

Documentation

Rust: https://docs.rs/ddc-enhanced-rs

NodeJS: https://github.com/ThalusA/ddc-enhanced-rs/blob/master/index.d.ts

Examples

Rust

use ddc_enhanced_rs::{get_enhanced_displays, get_brightness,
                      set_brightness, does_display_support_ddc};

// index in array is the id of the display
fn main() -> Result<(), std::io::Error> {
    for id in 0..get_enhanced_displays(false)?.len() {
        let value = get_brightness(id)?.value();
        set_brightness(id, value + 2).unwrap();
    }
    Ok(())
}

NodeJS

import Display from "ddc-enhanced-rs";

for (const display_info of Display.info()) {
    const display = new Display(display_info.id);
    const { value } = display.get_brightness();
    display.set_brightness(value + 2);
}

Dependencies

~1.8–2.9MB
~61K SLoC