feat: add bindings for the switcheroo dbus service

This commit is contained in:
Ashley Wulber 2024-01-23 16:21:13 -05:00 committed by Ashley Wulber
parent 3644bc9099
commit 5dea929b73
4 changed files with 156 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#[tokio::main]
async fn main() -> zbus::Result<()> {
let connection = zbus::Connection::system().await?;
let proxy = switcheroo_control::SwitcherooControlProxy::new(&connection).await?;
println!("GPUs: {:?}", proxy.get_gpus().await?);
println!("HasDualGpu: {}", proxy.has_dual_gpu().await?);
println!("NumGPUs: {}", proxy.num_gpus().await?);
Ok(())
}