ddc-enhanced-rs
is a cross platform Rust crate and Node package for controlling monitors with DDC/CI.
Rust: https://docs.rs/ddc-enhanced-rs
NodeJS: https://github.com/ThalusA/ddc-enhanced-rs/blob/master/index.d.ts
```rust use ddcenhancedrs::{getenhanceddisplays, getbrightness, setbrightness};
// index in array is the id of the display fn main() -> Result<(), std::io::Error> { for id in 0..getenhanceddisplays(false)?.len() { if doesdisplaysupportddc(id)? { let value = getbrightness(id)?.value(); set_brightness(id, value + 2).unwrap(); } } Ok(()) } ```
```javascript import Display from "ddc-enhanced-rs";
for (const displayinfo of Display.info()) { const display = new Display(displayinfo.id); if (display.doessupportddc()) { const { value } = display.getbrightness(); display.setbrightness(value + 2); } } ```