feat: add bindings for the switcheroo dbus service
This commit is contained in:
parent
3644bc9099
commit
5dea929b73
4 changed files with 156 additions and 0 deletions
12
switcheroo-control/examples/switcheroo.rs
Normal file
12
switcheroo-control/examples/switcheroo.rs
Normal 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(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue