mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-09 16:10:34 -04:00
More stuff implemented.
Use zbus to register the bus name. Use async_std to get dbus session connection. Added missing interface_name in SmDbusApi. Removed parameters from SmDbusApi since those are passed, but not kept with the method definition, etc.
This commit is contained in:
parent
666ac09607
commit
f2133a5256
3 changed files with 52 additions and 16 deletions
28
src/main.rs
28
src/main.rs
|
@ -1,11 +1,33 @@
|
|||
use steamos_manager::{self, SmEntry, initialize_apis};
|
||||
use std::io::ErrorKind;
|
||||
|
||||
fn main() {
|
||||
use steamos_manager::*;
|
||||
|
||||
use zbus::{Connection, Result};
|
||||
|
||||
#[async_std::main]
|
||||
async fn main() -> Result<()>
|
||||
{
|
||||
// This daemon is responsible for creating a dbus api that steam client can use to do various OS
|
||||
// level things (change brightness, etc.) In order to do that it reads a folder of dbus api
|
||||
// configuration files and exposes each configuration with the api in the config file. In order
|
||||
// to know what to do with each it gets the information from the same config file about whether
|
||||
// to run a script or call some other dbus api.
|
||||
|
||||
let mut manager_apis: Vec<SmEntry> = initialize_apis("/usr/share/steamos-manager".to_string());
|
||||
let session_connection = Connection::session().await?;
|
||||
session_connection.request_name("com.steampowered.SteamOSManager").await?;
|
||||
|
||||
let result = initialize_apis("/usr/share/steamos-manager".to_string());
|
||||
match result {
|
||||
Ok(manager_apis) => {
|
||||
let worked: bool = create_dbus_apis(session_connection, manager_apis);
|
||||
}
|
||||
Err(error) => {
|
||||
println!("There was an error reading configuration files, doing nothing. {:?}", error);
|
||||
}
|
||||
}
|
||||
|
||||
loop
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue