Overview
Definitions to get and set brightness on Linux. This relies on D-Bus and logind.
Example
use Brightness;
use TryStreamExt;
async
Contribute
All contributions shall be licensed under the 0BSD license.
Definitions to get and set brightness on Linux. This relies on D-Bus and logind.
use brightness::Brightness;
use futures::TryStreamExt;
async fn show_brightness() -> Result<(), brightness::Error> {
brightness::brightness_devices().try_for_each(|dev| async move {
let name = dev.device_name().await?;
let value = dev.get().await?;
println!("Brightness of device {} is {}%", name, value);
Ok(())
}).await
}
All contributions shall be licensed under the 0BSD license.