Crates.io | ddc-enhanced-rs |
lib.rs | ddc-enhanced-rs |
version | 1.2.7 |
source | src |
created_at | 2022-03-30 19:58:12.731122 |
updated_at | 2022-06-19 16:07:11.998416 |
description | DDC/CI high level library for Rust (cross platform) |
homepage | https://github.com/ThalusA/ddc-enhanced-rs#readme |
repository | https://github.com/ThalusA/ddc-enhanced-rs |
max_upload_size | |
id | 559374 |
size | 20,854 |
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
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(())
}
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);
}