Iced graphics applet (#26)

* feat: builds deb

* feat: working iced graphics applet

* fix: update deps to get fixes for iced-sctk

* fix: better popup size

* fix: better styling of button & popup

* fix: better popup container

* feat: sticky graphics mode after selection

* fix: refactor & handle close requests
This commit is contained in:
Ashley Wulber 2022-11-17 16:38:48 +01:00 committed by GitHub
parent e3be1c1809
commit eab7ddea1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 3836 additions and 360 deletions

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//! # DBus interface proxy for: `com.system76.PowerDaemon`
//!
//! This code was generated by `zbus-xmlgen` `2.0.1` from DBus introspection data.
//! This code was generated by `zbus-xmlgen` `3.0.0` from DBus introspection data.
//! Source: `Interface '/com/system76/PowerDaemon' from service 'com.system76.PowerDaemon' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
@ -18,11 +18,10 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use zbus::dbus_proxy;
use zbus::{dbus_proxy, Connection};
#[dbus_proxy(
interface = "com.system76.PowerDaemon",
default_service = "com.system76.PowerDaemon",
default_path = "/com/system76/PowerDaemon"
)]
trait PowerDaemon {
@ -78,3 +77,17 @@ trait PowerDaemon {
#[dbus_proxy(signal)]
fn power_profile_switch(&self, profile: &str) -> zbus::Result<()>;
}
pub async fn init() -> Option<(Connection, PowerDaemonProxy<'static>)> {
let conn = match Connection::system().await {
Ok(conn) => conn,
_ => return None,
};
let proxy = match PowerDaemonProxy::new(&conn).await {
Ok(p) => p,
_ => return None,
};
Some((conn, proxy))
}