diff --git a/Cargo.toml b/Cargo.toml index df9026d..58a574e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "cosmic-settings-daemon", "geoclue2", "hostname1", + "locale1", "mpris2", "networkmanager", "switcheroo-control", diff --git a/locale1/Cargo.toml b/locale1/Cargo.toml new file mode 100644 index 0000000..8552bbf --- /dev/null +++ b/locale1/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "locale1" +version = "0.1.0" +edition = "2021" + +[dependencies] +zbus.workspace = true + +[dev-dependencies] +futures = "0.3" +tokio = { version = "1", features = ["full"] } +zbus.workspace = true +zbus.features = ["tokio"] \ No newline at end of file diff --git a/locale1/examples/locale.rs b/locale1/examples/locale.rs new file mode 100644 index 0000000..ccedb66 --- /dev/null +++ b/locale1/examples/locale.rs @@ -0,0 +1,14 @@ +#[tokio::main] +async fn main() -> zbus::Result<()> { + let connection = zbus::Connection::system().await?; + + let proxy = locale1::locale1Proxy::new(&connection).await?; + + println!("Locale {:?}", proxy.locale().await?); + println!("Layout {:?}", proxy.x11layout().await?); + println!("Model {:?}", proxy.x11model().await?); + println!("Options {:?}", proxy.x11options().await?); + println!("Variant {:?}", proxy.x11variant().await?); + + Ok(()) +} diff --git a/locale1/src/lib.rs b/locale1/src/lib.rs new file mode 100644 index 0000000..fc395a1 --- /dev/null +++ b/locale1/src/lib.rs @@ -0,0 +1,65 @@ +//! # D-Bus interface proxy for: `org.freedesktop.locale1` +//! +//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data. +//! Source: `Interface '/org/freedesktop/locale1' from service 'org.freedesktop.locale1' on system bus`. + +use zbus::proxy; +#[proxy( + interface = "org.freedesktop.locale1", + default_service = "org.freedesktop.locale1", + default_path = "/org/freedesktop/locale1" +)] +trait locale1 { + /// SetLocale method + fn set_locale(&self, locale: &[&str], interactive: bool) -> zbus::Result<()>; + + /// SetVConsoleKeyboard method + #[zbus(name = "SetVConsoleKeyboard")] + fn set_vconsole_keyboard( + &self, + keymap: &str, + keymap_toggle: &str, + convert: bool, + interactive: bool, + ) -> zbus::Result<()>; + + /// SetX11Keyboard method + #[zbus(name = "SetX11Keyboard")] + fn set_x11keyboard( + &self, + layout: &str, + model: &str, + variant: &str, + options: &str, + convert: bool, + interactive: bool, + ) -> zbus::Result<()>; + + /// Locale property + #[zbus(property)] + fn locale(&self) -> zbus::Result>; + + /// VConsoleKeymap property + #[zbus(property, name = "VConsoleKeymap")] + fn vconsole_keymap(&self) -> zbus::Result; + + /// VConsoleKeymapToggle property + #[zbus(property, name = "VConsoleKeymapToggle")] + fn vconsole_keymap_toggle(&self) -> zbus::Result; + + /// X11Layout property + #[zbus(property, name = "X11Layout")] + fn x11layout(&self) -> zbus::Result; + + /// X11Model property + #[zbus(property, name = "X11Model")] + fn x11model(&self) -> zbus::Result; + + /// X11Options property + #[zbus(property, name = "X11Options")] + fn x11options(&self) -> zbus::Result; + + /// X11Variant property + #[zbus(property, name = "X11Variant")] + fn x11variant(&self) -> zbus::Result; +}