Add Ally X config

This commit is contained in:
Luke D. Jones
2024-07-25 22:51:21 +12:00
parent e4dd485dd4
commit 14acab9a9c
11 changed files with 320 additions and 24 deletions

View File

@@ -74,13 +74,7 @@ async fn main() -> Result<()> {
.format_timestamp(None)
.init();
let supported_properties = match proxy.supported_properties() {
Ok(s) => s,
Err(_e) => {
// TODO: show an error window
Vec::default()
}
};
let supported_properties = proxy.supported_properties().unwrap_or_default();
// Startup
let mut config = Config::new().load();

View File

@@ -191,17 +191,14 @@ pub fn start_notifications(
let enabled_notifications_copy = config.clone();
// GPU Mode change/action notif
tokio::spawn(async move {
let conn = zbus::Connection::system().await.map_err(|e| {
no_supergfx(&e);
e
let conn = zbus::Connection::system().await.inspect_err(|e| {
no_supergfx(e);
})?;
let proxy = SuperProxy::builder(&conn).build().await.map_err(|e| {
no_supergfx(&e);
e
let proxy = SuperProxy::builder(&conn).build().await.inspect_err(|e| {
no_supergfx(e);
})?;
let _ = proxy.mode().await.map_err(|e| {
no_supergfx(&e);
e
let _ = proxy.mode().await.inspect_err(|e| {
no_supergfx(e);
})?;
let proxy_copy = proxy.clone();