Merge pull request #16 from pop-os/locale1
feat: Add bindings for locale1
This commit is contained in:
commit
cd21ddcb1b
4 changed files with 93 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ members = [
|
||||||
"cosmic-settings-daemon",
|
"cosmic-settings-daemon",
|
||||||
"geoclue2",
|
"geoclue2",
|
||||||
"hostname1",
|
"hostname1",
|
||||||
|
"locale1",
|
||||||
"mpris2",
|
"mpris2",
|
||||||
"networkmanager",
|
"networkmanager",
|
||||||
"switcheroo-control",
|
"switcheroo-control",
|
||||||
|
|
|
||||||
13
locale1/Cargo.toml
Normal file
13
locale1/Cargo.toml
Normal file
|
|
@ -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"]
|
||||||
14
locale1/examples/locale.rs
Normal file
14
locale1/examples/locale.rs
Normal file
|
|
@ -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(())
|
||||||
|
}
|
||||||
65
locale1/src/lib.rs
Normal file
65
locale1/src/lib.rs
Normal file
|
|
@ -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<Vec<String>>;
|
||||||
|
|
||||||
|
/// VConsoleKeymap property
|
||||||
|
#[zbus(property, name = "VConsoleKeymap")]
|
||||||
|
fn vconsole_keymap(&self) -> zbus::Result<String>;
|
||||||
|
|
||||||
|
/// VConsoleKeymapToggle property
|
||||||
|
#[zbus(property, name = "VConsoleKeymapToggle")]
|
||||||
|
fn vconsole_keymap_toggle(&self) -> zbus::Result<String>;
|
||||||
|
|
||||||
|
/// X11Layout property
|
||||||
|
#[zbus(property, name = "X11Layout")]
|
||||||
|
fn x11layout(&self) -> zbus::Result<String>;
|
||||||
|
|
||||||
|
/// X11Model property
|
||||||
|
#[zbus(property, name = "X11Model")]
|
||||||
|
fn x11model(&self) -> zbus::Result<String>;
|
||||||
|
|
||||||
|
/// X11Options property
|
||||||
|
#[zbus(property, name = "X11Options")]
|
||||||
|
fn x11options(&self) -> zbus::Result<String>;
|
||||||
|
|
||||||
|
/// X11Variant property
|
||||||
|
#[zbus(property, name = "X11Variant")]
|
||||||
|
fn x11variant(&self) -> zbus::Result<String>;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue