feat: cosmic settings daemon (#8)
* feat: cosmic settings daemon * refactor: simplify by unifying trait for state and config * chore: add ping and pong methods * refactor: remove ping & pong methods * cleanup
This commit is contained in:
parent
2ef53b2bfa
commit
3644bc9099
4 changed files with 124 additions and 0 deletions
75
cosmic-settings-daemon/src/lib.rs
Normal file
75
cosmic-settings-daemon/src/lib.rs
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
//! # DBus interface proxy for: `com.system76.CosmicSettingsDaemon`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `3.1.1` from DBus introspection data.
|
||||
//! Source: `Interface '/com/system76/CosmicSettingsDaemon' from service 'com.system76.CosmicSettingsDaemon' on session bus`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
//! This DBus object implements
|
||||
//! [standard DBus interfaces](https://dbus.freedesktop.org/doc/dbus-specification.html),
|
||||
//! (`org.freedesktop.DBus.*`) for which the following zbus proxies can be used:
|
||||
//!
|
||||
//! * [`zbus::fdo::PeerProxy`]
|
||||
//! * [`zbus::fdo::PropertiesProxy`]
|
||||
//! * [`zbus::fdo::IntrospectableProxy`]
|
||||
//!
|
||||
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
||||
|
||||
use zbus::{dbus_proxy, names::OwnedWellKnownName};
|
||||
|
||||
#[dbus_proxy(
|
||||
interface = "com.system76.CosmicSettingsDaemon",
|
||||
default_service = "com.system76.CosmicSettingsDaemon",
|
||||
default_path = "/com/system76/CosmicSettingsDaemon"
|
||||
)]
|
||||
trait CosmicSettingsDaemon {
|
||||
/// DecreaseDisplayBrightness method
|
||||
fn decrease_display_brightness(&self) -> zbus::Result<()>;
|
||||
|
||||
/// DecreaseKeyboardBrightness method
|
||||
fn decrease_keyboard_brightness(&self) -> zbus::Result<()>;
|
||||
|
||||
/// IncreaseDisplayBrightness method
|
||||
fn increase_display_brightness(&self) -> zbus::Result<()>;
|
||||
|
||||
/// IncreaseKeyboardBrightness method
|
||||
fn increase_keyboard_brightness(&self) -> zbus::Result<()>;
|
||||
|
||||
/// WatchConfig method
|
||||
fn watch_config(
|
||||
&self,
|
||||
id: &str,
|
||||
version: u64,
|
||||
) -> zbus::Result<(zbus::zvariant::OwnedObjectPath, OwnedWellKnownName)>;
|
||||
|
||||
/// WatchState method
|
||||
fn watch_state(
|
||||
&self,
|
||||
id: &str,
|
||||
version: u64,
|
||||
) -> zbus::Result<(zbus::zvariant::OwnedObjectPath, OwnedWellKnownName)>;
|
||||
|
||||
/// DisplayBrightness property
|
||||
#[dbus_proxy(property)]
|
||||
fn display_brightness(&self) -> zbus::Result<i32>;
|
||||
fn set_display_brightness(&self, value: i32) -> zbus::Result<()>;
|
||||
|
||||
/// KeyboardBrightness property
|
||||
#[dbus_proxy(property)]
|
||||
fn keyboard_brightness(&self) -> zbus::Result<i32>;
|
||||
fn set_keyboard_brightness(&self, value: i32) -> zbus::Result<()>;
|
||||
}
|
||||
|
||||
#[dbus_proxy(
|
||||
interface = "com.system76.CosmicSettingsDaemon.Config",
|
||||
default_service = "com.system76.CosmicSettingsDaemon.Config"
|
||||
)]
|
||||
trait Config {
|
||||
/// Changed signal
|
||||
#[dbus_proxy(signal)]
|
||||
async fn changed(&self, id: String, key: String) -> zbus::Result<()>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue